@syncfusion/ej2-filemanager 25.2.6 → 26.1.40
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 -462
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +975 -515
- 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 +37 -13
- 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 +25 -24
- 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 +260 -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 +2868 -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 +2868 -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 -475
@@ -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 */
|
@@ -6311,8 +6822,17 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6311
6822
|
if (uid === this.parent.pathId[0]) {
|
6312
6823
|
this.disabledItems.push('Delete', 'Rename', 'Cut', 'Copy');
|
6313
6824
|
}
|
6825
|
+
else {
|
6826
|
+
var itemsToRemove = ['Delete', 'Rename', 'Cut', 'Copy'];
|
6827
|
+
for (var i = 0; i < this.disabledItems.length; i++) {
|
6828
|
+
var item = this.disabledItems[i];
|
6829
|
+
if (itemsToRemove.indexOf(item) !== -1) {
|
6830
|
+
this.disabledItems.splice(i, 1);
|
6831
|
+
i--;
|
6832
|
+
}
|
6833
|
+
}
|
6834
|
+
}
|
6314
6835
|
/* istanbul ignore next */
|
6315
|
-
// eslint:disable-next-line
|
6316
6836
|
}
|
6317
6837
|
else if (view === 'TreeView' || view === 'GridView' || view === 'LargeIcon') {
|
6318
6838
|
this.setLayoutItem(target);
|
@@ -6370,7 +6890,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6370
6890
|
}
|
6371
6891
|
});
|
6372
6892
|
};
|
6373
|
-
ContextMenu
|
6893
|
+
ContextMenu.prototype.updateActiveModule = function () {
|
6374
6894
|
this.parent.activeModule = closest(this.menuTarget, '#' + this.parent.element.id + TREE_ID) ?
|
6375
6895
|
'navigationpane' : closest(this.menuTarget, '#' + this.parent.element.id + GRID_ID) ?
|
6376
6896
|
'detailsview' : closest(this.menuTarget, '#' + this.parent.element.id + LARGEICON_ID) ?
|
@@ -6383,14 +6903,14 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6383
6903
|
* @returns {string} -returns the target view.
|
6384
6904
|
* @hidden
|
6385
6905
|
*/
|
6386
|
-
ContextMenu
|
6906
|
+
ContextMenu.prototype.getTargetView = function (target) {
|
6387
6907
|
return target.classList.contains(TREE_VIEW) ?
|
6388
6908
|
'TreeView' : target.classList.contains(GRID_VIEW) ?
|
6389
6909
|
'GridView' : target.classList.contains(ICON_VIEW) ?
|
6390
6910
|
'LargeIcon' : target.classList.contains(LARGE_ICONS) ?
|
6391
6911
|
'LargeIcon' : '';
|
6392
6912
|
};
|
6393
|
-
ContextMenu
|
6913
|
+
ContextMenu.prototype.getItemIndex = function (item) {
|
6394
6914
|
var itemId = this.getMenuId(item);
|
6395
6915
|
for (var i = 0; i < this.currentItems.length; i++) {
|
6396
6916
|
if ((this.currentItems[i].id === itemId) || (this.currentItems[i].id === item)) {
|
@@ -6399,12 +6919,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6399
6919
|
}
|
6400
6920
|
return -1;
|
6401
6921
|
};
|
6402
|
-
ContextMenu
|
6922
|
+
ContextMenu.prototype.disableItem = function (items) {
|
6403
6923
|
if (items.length !== 0) {
|
6404
6924
|
this.disabledItems = this.disabledItems.concat(items);
|
6405
6925
|
}
|
6406
6926
|
};
|
6407
|
-
ContextMenu
|
6927
|
+
ContextMenu.prototype.enableItems = function (items, enable, isUniqueId) {
|
6408
6928
|
for (var i = 0; i < items.length; i++) {
|
6409
6929
|
if (this.checkValidItem(items[i]) === 1) {
|
6410
6930
|
this.contextMenu.enableItems([this.getMenuId(items[i])], enable, isUniqueId);
|
@@ -6414,7 +6934,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6414
6934
|
}
|
6415
6935
|
}
|
6416
6936
|
};
|
6417
|
-
ContextMenu
|
6937
|
+
ContextMenu.prototype.setFolderItem = function (isTree) {
|
6418
6938
|
this.menuType = 'folder';
|
6419
6939
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.folder.map(function (item) { return item.trim(); }));
|
6420
6940
|
this.contextMenu.dataBind();
|
@@ -6423,6 +6943,18 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6423
6943
|
if (this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
|
6424
6944
|
this.disabledItems.push('Open');
|
6425
6945
|
}
|
6946
|
+
else {
|
6947
|
+
var indexToRemove = this.disabledItems.indexOf('Open');
|
6948
|
+
if (indexToRemove !== -1) {
|
6949
|
+
this.disabledItems.splice(indexToRemove, 1);
|
6950
|
+
}
|
6951
|
+
}
|
6952
|
+
if (this.parent.selectedItems.length === 0) {
|
6953
|
+
var renameIndex = this.disabledItems.indexOf('Rename');
|
6954
|
+
if (renameIndex !== -1) {
|
6955
|
+
this.disabledItems.splice(renameIndex, 1);
|
6956
|
+
}
|
6957
|
+
}
|
6426
6958
|
}
|
6427
6959
|
else if (this.parent.activeModule !== 'navigationpane') {
|
6428
6960
|
if (this.parent.selectedItems.length === 1) {
|
@@ -6436,7 +6968,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6436
6968
|
}
|
6437
6969
|
}
|
6438
6970
|
};
|
6439
|
-
ContextMenu
|
6971
|
+
ContextMenu.prototype.setFileItem = function () {
|
6440
6972
|
this.menuType = 'file';
|
6441
6973
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.file.map(function (item) { return item.trim(); }));
|
6442
6974
|
this.contextMenu.dataBind();
|
@@ -6450,7 +6982,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6450
6982
|
this.disabledItems.push('Rename');
|
6451
6983
|
}
|
6452
6984
|
};
|
6453
|
-
ContextMenu
|
6985
|
+
ContextMenu.prototype.setLayoutItem = function (target) {
|
6454
6986
|
this.menuType = 'layout';
|
6455
6987
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.layout.map(function (item) { return item.trim(); }));
|
6456
6988
|
this.contextMenu.dataBind();
|
@@ -6470,7 +7002,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6470
7002
|
}
|
6471
7003
|
this.contextMenu.dataBind();
|
6472
7004
|
};
|
6473
|
-
ContextMenu
|
7005
|
+
ContextMenu.prototype.checkValidItem = function (nameEle) {
|
6474
7006
|
if (!isNullOrUndefined(select('#' + this.getMenuId(nameEle), this.currentElement))) {
|
6475
7007
|
return 1;
|
6476
7008
|
}
|
@@ -6481,26 +7013,23 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6481
7013
|
return -1;
|
6482
7014
|
}
|
6483
7015
|
};
|
6484
|
-
|
6485
|
-
ContextMenu$$1.prototype.getMenuItemData = function () {
|
7016
|
+
ContextMenu.prototype.getMenuItemData = function () {
|
6486
7017
|
if (this.menuType === 'layout') {
|
6487
7018
|
return getPathObject(this.parent);
|
6488
7019
|
}
|
6489
7020
|
else {
|
6490
|
-
// eslint-disable-next-line
|
6491
7021
|
var args = { target: this.menuTarget };
|
6492
7022
|
this.parent.notify(menuItemData, args);
|
6493
7023
|
return this.parent.itemData[0];
|
6494
7024
|
}
|
6495
7025
|
};
|
6496
7026
|
/* istanbul ignore next */
|
6497
|
-
ContextMenu
|
7027
|
+
ContextMenu.prototype.onSelect = function (args) {
|
6498
7028
|
var _this = this;
|
6499
7029
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
6500
7030
|
return;
|
6501
7031
|
}
|
6502
7032
|
var itemText = args.item.id.substr((this.parent.element.id + '_cm_').length);
|
6503
|
-
// eslint-disable-next-line
|
6504
7033
|
var details;
|
6505
7034
|
if (itemText === 'refresh' || itemText === 'newfolder' || itemText === 'upload') {
|
6506
7035
|
details = [getPathObject(this.parent)];
|
@@ -6525,7 +7054,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6525
7054
|
var sItems;
|
6526
7055
|
if (!menuClickArgs.cancel) {
|
6527
7056
|
_this.isMenuItemClicked = true;
|
6528
|
-
// eslint:disable-next-line
|
6529
7057
|
switch (itemText) {
|
6530
7058
|
case 'cut':
|
6531
7059
|
cutFiles(_this.parent);
|
@@ -6613,19 +7141,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6613
7141
|
case 'upload':
|
6614
7142
|
uploadItem(_this.parent);
|
6615
7143
|
break;
|
6616
|
-
/* istanbul ignore next */
|
6617
7144
|
case 'name':
|
6618
|
-
/* istanbul ignore next */
|
6619
|
-
// eslint-disable-next-line no-fallthrough
|
6620
7145
|
case 'size':
|
6621
|
-
/* istanbul ignore next */
|
6622
|
-
// eslint-disable-next-line no-fallthrough
|
6623
7146
|
case 'date':
|
6624
|
-
/* istanbul ignore next */
|
6625
|
-
// eslint-disable-next-line no-fallthrough
|
6626
7147
|
case 'ascending':
|
6627
|
-
/* istanbul ignore next */
|
6628
|
-
// eslint-disable-next-line no-fallthrough
|
6629
7148
|
case 'descending':
|
6630
7149
|
/* istanbul ignore next */
|
6631
7150
|
sortbyClickHandler(_this.parent, args);
|
@@ -6636,12 +7155,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6636
7155
|
sortbyClickHandler(_this.parent, args);
|
6637
7156
|
break;
|
6638
7157
|
/* istanbul ignore next */
|
6639
|
-
// eslint:disable-next-line
|
6640
7158
|
case 'largeiconsview':
|
6641
7159
|
updateLayout(_this.parent, 'LargeIcons');
|
6642
7160
|
break;
|
6643
7161
|
/* istanbul ignore next */
|
6644
|
-
// eslint:disable-next-line
|
6645
7162
|
case 'detailsview':
|
6646
7163
|
updateLayout(_this.parent, 'Details');
|
6647
7164
|
break;
|
@@ -6649,7 +7166,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6649
7166
|
}
|
6650
7167
|
});
|
6651
7168
|
};
|
6652
|
-
ContextMenu
|
7169
|
+
ContextMenu.prototype.onPropertyChanged = function (e) {
|
6653
7170
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
6654
7171
|
/* istanbul ignore next */
|
6655
7172
|
return;
|
@@ -6663,7 +7180,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6663
7180
|
}
|
6664
7181
|
}
|
6665
7182
|
};
|
6666
|
-
ContextMenu
|
7183
|
+
ContextMenu.prototype.addEventListener = function () {
|
6667
7184
|
this.parent.on(destroy, this.destroy, this);
|
6668
7185
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
6669
7186
|
this.keyboardModule = new KeyboardEvents(this.contextMenu.element, {
|
@@ -6672,12 +7189,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6672
7189
|
eventName: 'keydown'
|
6673
7190
|
});
|
6674
7191
|
};
|
6675
|
-
ContextMenu
|
7192
|
+
ContextMenu.prototype.removeEventListener = function () {
|
6676
7193
|
this.parent.off(destroy, this.destroy);
|
6677
7194
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
6678
7195
|
this.keyboardModule.destroy();
|
6679
7196
|
};
|
6680
|
-
ContextMenu
|
7197
|
+
ContextMenu.prototype.keyActionHandler = function (e) {
|
6681
7198
|
switch (e.action) {
|
6682
7199
|
case 'uparrow':
|
6683
7200
|
case 'downarrow':
|
@@ -6690,10 +7207,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6690
7207
|
* @returns {string} - returns the module name.
|
6691
7208
|
* @private
|
6692
7209
|
*/
|
6693
|
-
ContextMenu
|
7210
|
+
ContextMenu.prototype.getModuleName = function () {
|
6694
7211
|
return 'contextmenu';
|
6695
7212
|
};
|
6696
|
-
ContextMenu
|
7213
|
+
ContextMenu.prototype.destroy = function () {
|
6697
7214
|
if (this.parent.isDestroyed) {
|
6698
7215
|
return;
|
6699
7216
|
}
|
@@ -6702,7 +7219,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6702
7219
|
this.targetElement = null;
|
6703
7220
|
};
|
6704
7221
|
/* istanbul ignore next */
|
6705
|
-
ContextMenu
|
7222
|
+
ContextMenu.prototype.getItemData = function (data) {
|
6706
7223
|
var items = [];
|
6707
7224
|
for (var i = 0; i < data.length; i++) {
|
6708
7225
|
var item = void 0;
|
@@ -6806,16 +7323,15 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6806
7323
|
}
|
6807
7324
|
return items;
|
6808
7325
|
};
|
6809
|
-
ContextMenu
|
7326
|
+
ContextMenu.prototype.getMenuId = function (id) {
|
6810
7327
|
return this.parent.element.id + '_cm_' + id.split(' ').join('').toLowerCase();
|
6811
7328
|
};
|
6812
|
-
return ContextMenu
|
7329
|
+
return ContextMenu;
|
6813
7330
|
}());
|
6814
7331
|
|
6815
7332
|
/**
|
6816
7333
|
* Specifies the default locale of FileManager component
|
6817
7334
|
*/
|
6818
|
-
// eslint-disable-next-line
|
6819
7335
|
var defaultLocale = {
|
6820
7336
|
'NewFolder': 'New folder',
|
6821
7337
|
'Upload': 'Upload',
|
@@ -6949,14 +7465,13 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6949
7465
|
__extends$8(FileManager, _super);
|
6950
7466
|
function FileManager(options, element) {
|
6951
7467
|
var _this = _super.call(this, options, element) || this;
|
6952
|
-
// eslint-disable-next-line
|
6953
7468
|
_this.filterData = null;
|
6954
7469
|
_this.selectedNodes = [];
|
6955
7470
|
_this.duplicateItems = [];
|
6956
|
-
// eslint-disable-next-line
|
6957
7471
|
_this.duplicateRecords = [];
|
6958
7472
|
_this.previousPath = [];
|
6959
7473
|
_this.nextPath = [];
|
7474
|
+
_this.existingFileCount = 0;
|
6960
7475
|
_this.isLayoutChange = false;
|
6961
7476
|
_this.layoutSelectedItems = [];
|
6962
7477
|
_this.renamedId = null;
|
@@ -6978,11 +7493,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6978
7493
|
_this.isOpened = false;
|
6979
7494
|
_this.isRetryOpened = false;
|
6980
7495
|
_this.isPathDrag = false;
|
6981
|
-
// eslint-disable-next-line
|
6982
7496
|
_this.searchedItems = [];
|
6983
7497
|
_this.retryFiles = [];
|
6984
7498
|
_this.isApplySame = false;
|
6985
|
-
// eslint-disable-next-line
|
6986
7499
|
_this.dragData = [];
|
6987
7500
|
_this.dragNodes = [];
|
6988
7501
|
_this.dragPath = '';
|
@@ -6992,13 +7505,12 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6992
7505
|
_this.dragCursorPosition = { left: 44, top: 18 };
|
6993
7506
|
_this.isDropEnd = false;
|
6994
7507
|
_this.dragCount = 0;
|
6995
|
-
// eslint-disable-next-line
|
6996
7508
|
_this.droppedObjects = [];
|
6997
7509
|
_this.uploadingCount = 0;
|
6998
7510
|
_this.uploadedCount = 0;
|
6999
|
-
//Specifies whether the operating system is MAC or not
|
7511
|
+
//Specifies whether the operating system is MAC or not
|
7000
7512
|
_this.isMac = false;
|
7001
|
-
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu
|
7513
|
+
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
|
7002
7514
|
return _this;
|
7003
7515
|
}
|
7004
7516
|
FileManager_1 = FileManager;
|
@@ -7390,7 +7902,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7390
7902
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
7391
7903
|
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
7392
7904
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
7393
|
-
// eslint-disable-next-line
|
7394
7905
|
var ajaxSettings = {
|
7395
7906
|
url: uploadUrl,
|
7396
7907
|
type: 'POST',
|
@@ -7406,7 +7917,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7406
7917
|
this.trigger('beforeSend', this.uploadEventArgs, function (uploadEventArgs) {
|
7407
7918
|
args.customFormData = JSON.parse(getValue('data', uploadEventArgs.ajaxSettings));
|
7408
7919
|
args.cancel = uploadEventArgs.cancel;
|
7409
|
-
// eslint-disable-next-line
|
7410
7920
|
var eventArgs = {
|
7411
7921
|
cancel: false,
|
7412
7922
|
httpRequest: args.currentRequest
|
@@ -7443,7 +7953,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7443
7953
|
}
|
7444
7954
|
this.uploadingCount = args.filesData.length;
|
7445
7955
|
this.uploadedCount = 0;
|
7446
|
-
// eslint-disable-next-line
|
7447
7956
|
var details = getPathObject(this);
|
7448
7957
|
if (!hasUploadAccess(details)) {
|
7449
7958
|
args.cancel = true;
|
@@ -7452,7 +7961,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7452
7961
|
}
|
7453
7962
|
this.uploadDialogObj.show();
|
7454
7963
|
};
|
7455
|
-
// eslint-disable-next-line
|
7456
7964
|
FileManager.prototype.onFileUploadSuccess = function (args) {
|
7457
7965
|
this.uploadedCount = this.uploadedCount + args.count;
|
7458
7966
|
if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
|
@@ -7460,7 +7968,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7460
7968
|
}
|
7461
7969
|
};
|
7462
7970
|
/* istanbul ignore next */
|
7463
|
-
// eslint-disable-next-line
|
7464
7971
|
FileManager.prototype.onUploadSuccess = function (files) {
|
7465
7972
|
var args = { action: 'Upload', result: files };
|
7466
7973
|
this.trigger('success', args);
|
@@ -7472,9 +7979,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7472
7979
|
}
|
7473
7980
|
};
|
7474
7981
|
/* istanbul ignore next */
|
7475
|
-
// eslint-disable-next-line
|
7476
7982
|
FileManager.prototype.onUploadFailure = function (files) {
|
7477
|
-
// eslint-disable-next-line
|
7478
7983
|
var response = getValue('response', files);
|
7479
7984
|
var statusText = getValue('statusText', response);
|
7480
7985
|
if (statusText !== '') {
|
@@ -7558,7 +8063,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7558
8063
|
break;
|
7559
8064
|
case 'ctrlU':
|
7560
8065
|
e.preventDefault();
|
7561
|
-
if (this.toolbarSettings.items.indexOf('Upload')
|
8066
|
+
if (this.toolbarSettings.items.indexOf('Upload') !== -1) {
|
7562
8067
|
uploadEle = select('#' + this.element.id + UPLOAD_ID, this.element);
|
7563
8068
|
uploadEle.click();
|
7564
8069
|
}
|
@@ -7592,7 +8097,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7592
8097
|
* @private
|
7593
8098
|
*/
|
7594
8099
|
/* istanbul ignore next */
|
7595
|
-
// eslint:disable-next-line
|
7596
8100
|
FileManager.prototype.onPropertyChanged = function (newProp, oldProp) {
|
7597
8101
|
var height;
|
7598
8102
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
@@ -7725,6 +8229,10 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7725
8229
|
this.viewerObj.target = newProp.popupTarget;
|
7726
8230
|
}
|
7727
8231
|
break;
|
8232
|
+
case 'fileSystemData':
|
8233
|
+
this.fileSystemData = newProp.fileSystemData;
|
8234
|
+
this.refresh();
|
8235
|
+
break;
|
7728
8236
|
}
|
7729
8237
|
}
|
7730
8238
|
};
|
@@ -7810,7 +8318,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7810
8318
|
*/
|
7811
8319
|
FileManager.prototype.createFolder = function (name) {
|
7812
8320
|
this.notify(methodCall, { action: 'createFolder' });
|
7813
|
-
// eslint-disable-next-line
|
7814
8321
|
var details = [getPathObject(this)];
|
7815
8322
|
this.itemData = details;
|
7816
8323
|
if (name) {
|
@@ -7933,7 +8440,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7933
8440
|
*
|
7934
8441
|
* @returns {void}
|
7935
8442
|
*/
|
7936
|
-
// eslint-disable-next-line
|
7937
8443
|
FileManager.prototype.filterFiles = function (filterData) {
|
7938
8444
|
this.filterData = filterData ? filterData : null;
|
7939
8445
|
this.setProperties({ selectedItems: [] }, true);
|
@@ -7949,7 +8455,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7949
8455
|
*
|
7950
8456
|
* @returns {Object[]} - returns selected files.
|
7951
8457
|
*/
|
7952
|
-
// eslint-disable-next-line
|
7953
8458
|
FileManager.prototype.getSelectedFiles = function () {
|
7954
8459
|
this.notify(updateSelectionData, {});
|
7955
8460
|
return this.itemData;
|
@@ -8021,11 +8526,18 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8021
8526
|
* @returns {void}
|
8022
8527
|
*/
|
8023
8528
|
FileManager.prototype.uploadFiles = function () {
|
8024
|
-
// eslint-disable-next-line
|
8025
8529
|
var details = [getPathObject(this)];
|
8026
8530
|
this.itemData = details;
|
8027
8531
|
uploadItem(this);
|
8028
8532
|
};
|
8533
|
+
/**
|
8534
|
+
* Specifies the method which must be invoked to programmatically close the dialog popup in the file manager.
|
8535
|
+
*
|
8536
|
+
* @returns {void}
|
8537
|
+
*/
|
8538
|
+
FileManager.prototype.closeDialog = function () {
|
8539
|
+
closePopup(this);
|
8540
|
+
};
|
8029
8541
|
/**
|
8030
8542
|
* Specifies the direction of FileManager
|
8031
8543
|
*
|
@@ -8048,6 +8560,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8048
8560
|
__decorate$8([
|
8049
8561
|
Complex({}, AjaxSettings)
|
8050
8562
|
], FileManager.prototype, "ajaxSettings", void 0);
|
8563
|
+
__decorate$8([
|
8564
|
+
Property([])
|
8565
|
+
], FileManager.prototype, "fileSystemData", void 0);
|
8051
8566
|
__decorate$8([
|
8052
8567
|
Property(false)
|
8053
8568
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
@@ -8153,9 +8668,36 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8153
8668
|
__decorate$8([
|
8154
8669
|
Event()
|
8155
8670
|
], FileManager.prototype, "created", void 0);
|
8671
|
+
__decorate$8([
|
8672
|
+
Event()
|
8673
|
+
], FileManager.prototype, "beforeFolderCreate", void 0);
|
8674
|
+
__decorate$8([
|
8675
|
+
Event()
|
8676
|
+
], FileManager.prototype, "folderCreate", void 0);
|
8156
8677
|
__decorate$8([
|
8157
8678
|
Event()
|
8158
8679
|
], FileManager.prototype, "destroyed", void 0);
|
8680
|
+
__decorate$8([
|
8681
|
+
Event()
|
8682
|
+
], FileManager.prototype, "beforeDelete", void 0);
|
8683
|
+
__decorate$8([
|
8684
|
+
Event()
|
8685
|
+
], FileManager.prototype, "delete", void 0);
|
8686
|
+
__decorate$8([
|
8687
|
+
Event()
|
8688
|
+
], FileManager.prototype, "beforeRename", void 0);
|
8689
|
+
__decorate$8([
|
8690
|
+
Event()
|
8691
|
+
], FileManager.prototype, "rename", void 0);
|
8692
|
+
__decorate$8([
|
8693
|
+
Event()
|
8694
|
+
], FileManager.prototype, "beforeMove", void 0);
|
8695
|
+
__decorate$8([
|
8696
|
+
Event()
|
8697
|
+
], FileManager.prototype, "move", void 0);
|
8698
|
+
__decorate$8([
|
8699
|
+
Event()
|
8700
|
+
], FileManager.prototype, "search", void 0);
|
8159
8701
|
__decorate$8([
|
8160
8702
|
Event()
|
8161
8703
|
], FileManager.prototype, "fileDragStart", void 0);
|
@@ -8207,26 +8749,11 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8207
8749
|
return FileManager;
|
8208
8750
|
}(Component));
|
8209
8751
|
|
8210
|
-
/**
|
8211
|
-
* File Manager base modules
|
8212
|
-
*/
|
8213
|
-
|
8214
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
8215
|
-
__assign = Object.assign || function(t) {
|
8216
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
8217
|
-
s = arguments[i];
|
8218
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
8219
|
-
t[p] = s[p];
|
8220
|
-
}
|
8221
|
-
return t;
|
8222
|
-
};
|
8223
|
-
return __assign.apply(this, arguments);
|
8224
|
-
};
|
8225
8752
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
8226
8753
|
/**
|
8227
8754
|
* Toolbar module
|
8228
8755
|
*/
|
8229
|
-
var Toolbar
|
8756
|
+
var Toolbar = /** @__PURE__ @class */ (function () {
|
8230
8757
|
/**
|
8231
8758
|
* Constructor for the Toolbar module
|
8232
8759
|
*
|
@@ -8234,7 +8761,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8234
8761
|
* @param {IFileManager} parent - specifies the parent element.
|
8235
8762
|
* @private
|
8236
8763
|
*/
|
8237
|
-
function Toolbar
|
8764
|
+
function Toolbar(parent) {
|
8238
8765
|
this.default = ['Delete', 'Rename', 'Download', 'Cut', 'Copy', 'Paste'];
|
8239
8766
|
this.single = ['Delete', 'Rename', 'Download', 'Cut', 'Copy'];
|
8240
8767
|
this.multiple = ['Delete', 'Download', 'Cut', 'Copy', 'Refresh'];
|
@@ -8243,13 +8770,13 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8243
8770
|
this.render();
|
8244
8771
|
this.addEventListener();
|
8245
8772
|
}
|
8246
|
-
Toolbar
|
8773
|
+
Toolbar.prototype.render = function () {
|
8247
8774
|
var _this = this;
|
8248
8775
|
this.items = this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function (item) { return item.trim(); })));
|
8249
8776
|
var eventArgs = { items: this.items };
|
8250
8777
|
this.parent.trigger('toolbarCreate', eventArgs, function (toolbarCreateArgs) {
|
8251
8778
|
_this.items = toolbarCreateArgs.items;
|
8252
|
-
_this.toolbarObj = new Toolbar({
|
8779
|
+
_this.toolbarObj = new Toolbar$1({
|
8253
8780
|
items: _this.items,
|
8254
8781
|
created: _this.toolbarCreateHandler.bind(_this),
|
8255
8782
|
overflowMode: 'Popup',
|
@@ -8262,7 +8789,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8262
8789
|
_this.toolbarObj.appendTo('#' + _this.parent.element.id + TOOLBAR_ID);
|
8263
8790
|
});
|
8264
8791
|
};
|
8265
|
-
Toolbar
|
8792
|
+
Toolbar.prototype.getItemIndex = function (item) {
|
8266
8793
|
var itemId = this.getId(item);
|
8267
8794
|
for (var i = 0; i < this.items.length; i++) {
|
8268
8795
|
if (this.items[i].id === itemId) {
|
@@ -8271,7 +8798,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8271
8798
|
}
|
8272
8799
|
return -1;
|
8273
8800
|
};
|
8274
|
-
Toolbar
|
8801
|
+
Toolbar.prototype.getItems = function (items) {
|
8275
8802
|
var currItems = items.slice();
|
8276
8803
|
if (this.parent.isDevice && this.parent.allowMultiSelection) {
|
8277
8804
|
currItems.push('SelectAll');
|
@@ -8282,13 +8809,12 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8282
8809
|
return currItems;
|
8283
8810
|
};
|
8284
8811
|
/* istanbul ignore next */
|
8285
|
-
Toolbar
|
8812
|
+
Toolbar.prototype.onClicked = function (args) {
|
8286
8813
|
var _this = this;
|
8287
8814
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
8288
8815
|
return;
|
8289
8816
|
}
|
8290
8817
|
var tool = args.item.id.substr((this.parent.element.id + '_tb_').length);
|
8291
|
-
// eslint-disable-next-line
|
8292
8818
|
var details;
|
8293
8819
|
if (tool === 'refresh' || tool === 'newfolder' || tool === 'upload') {
|
8294
8820
|
details = [getPathObject(this.parent)];
|
@@ -8368,7 +8894,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8368
8894
|
}
|
8369
8895
|
});
|
8370
8896
|
};
|
8371
|
-
Toolbar
|
8897
|
+
Toolbar.prototype.toolbarCreateHandler = function () {
|
8372
8898
|
var _this = this;
|
8373
8899
|
if (!isNullOrUndefined(select('#' + this.getId('SortBy'), this.parent.element))) {
|
8374
8900
|
var items = [
|
@@ -8453,7 +8979,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8453
8979
|
}
|
8454
8980
|
this.parent.refreshLayout();
|
8455
8981
|
};
|
8456
|
-
Toolbar
|
8982
|
+
Toolbar.prototype.updateSortByButton = function () {
|
8457
8983
|
if (this.buttonObj) {
|
8458
8984
|
var items = this.buttonObj.items;
|
8459
8985
|
for (var itemCount = 0; itemCount < items.length; itemCount++) {
|
@@ -8483,10 +9009,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8483
9009
|
}
|
8484
9010
|
}
|
8485
9011
|
};
|
8486
|
-
Toolbar
|
9012
|
+
Toolbar.prototype.getPupupId = function (id) {
|
8487
9013
|
return this.parent.element.id + '_ddl_' + id.toLowerCase();
|
8488
9014
|
};
|
8489
|
-
Toolbar
|
9015
|
+
Toolbar.prototype.layoutChange = function (args) {
|
8490
9016
|
if (this.parent.view === 'Details') {
|
8491
9017
|
if (args.item.id === this.getPupupId('large')) {
|
8492
9018
|
updateLayout(this.parent, 'LargeIcons');
|
@@ -8498,7 +9024,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8498
9024
|
}
|
8499
9025
|
}
|
8500
9026
|
};
|
8501
|
-
Toolbar
|
9027
|
+
Toolbar.prototype.toolbarItemData = function (data) {
|
8502
9028
|
var items = [];
|
8503
9029
|
var mode = 'Both';
|
8504
9030
|
if (this.parent.isMobile) {
|
@@ -8591,7 +9117,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8591
9117
|
break;
|
8592
9118
|
}
|
8593
9119
|
if (this.parent.toolbarItems.length > 0 && propItem) {
|
8594
|
-
var mergedItems =
|
9120
|
+
var mergedItems = Object.assign({}, item, propItem);
|
8595
9121
|
items.push(mergedItems);
|
8596
9122
|
}
|
8597
9123
|
else {
|
@@ -8600,7 +9126,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8600
9126
|
}
|
8601
9127
|
return items;
|
8602
9128
|
};
|
8603
|
-
Toolbar
|
9129
|
+
Toolbar.prototype.getItemModel = function (propItem) {
|
8604
9130
|
var item = {};
|
8605
9131
|
if (propItem.id) {
|
8606
9132
|
item.id = propItem.id;
|
@@ -8655,10 +9181,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8655
9181
|
}
|
8656
9182
|
return item;
|
8657
9183
|
};
|
8658
|
-
Toolbar
|
9184
|
+
Toolbar.prototype.getId = function (id) {
|
8659
9185
|
return this.parent.element.id + '_tb_' + id.toLowerCase();
|
8660
9186
|
};
|
8661
|
-
Toolbar
|
9187
|
+
Toolbar.prototype.addEventListener = function () {
|
8662
9188
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
8663
9189
|
this.parent.on(selectionChanged, this.onSelectionChanged, this);
|
8664
9190
|
this.parent.on(layoutChange, this.onLayoutChange, this);
|
@@ -8667,7 +9193,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8667
9193
|
this.parent.on(destroy, this.destroy, this);
|
8668
9194
|
this.parent.on(sortByChange, this.updateSortByButton, this);
|
8669
9195
|
};
|
8670
|
-
Toolbar
|
9196
|
+
Toolbar.prototype.reRenderToolbar = function (e) {
|
8671
9197
|
var _this = this;
|
8672
9198
|
var itemsToProcess = [];
|
8673
9199
|
if (this.parent.toolbarItems.length > 0) {
|
@@ -8697,7 +9223,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8697
9223
|
});
|
8698
9224
|
}
|
8699
9225
|
};
|
8700
|
-
Toolbar
|
9226
|
+
Toolbar.prototype.onSelectionChanged = function () {
|
8701
9227
|
this.hideStatus();
|
8702
9228
|
this.hideItems(this.single, true);
|
8703
9229
|
this.hideItems(this.selection, false);
|
@@ -8722,7 +9248,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8722
9248
|
this.toolbarObj.hideItem(ele.parentElement, false);
|
8723
9249
|
}
|
8724
9250
|
};
|
8725
|
-
Toolbar
|
9251
|
+
Toolbar.prototype.hideItems = function (tools, toHide) {
|
8726
9252
|
for (var i = 0; i < tools.length; i++) {
|
8727
9253
|
var ele = select('#' + this.getId(tools[i]), this.parent.element);
|
8728
9254
|
if (ele) {
|
@@ -8730,19 +9256,19 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8730
9256
|
}
|
8731
9257
|
}
|
8732
9258
|
};
|
8733
|
-
Toolbar
|
9259
|
+
Toolbar.prototype.hideStatus = function () {
|
8734
9260
|
var ele = select('#' + this.getId('Selection'), this.toolbarObj.element);
|
8735
9261
|
if (ele) {
|
8736
9262
|
this.toolbarObj.hideItem(ele.parentElement, true);
|
8737
9263
|
}
|
8738
9264
|
};
|
8739
|
-
Toolbar
|
9265
|
+
Toolbar.prototype.showPaste = function () {
|
8740
9266
|
this.hideItems(['Paste'], false);
|
8741
9267
|
};
|
8742
|
-
Toolbar
|
9268
|
+
Toolbar.prototype.hidePaste = function () {
|
8743
9269
|
this.hideItems(['Paste'], true);
|
8744
9270
|
};
|
8745
|
-
Toolbar
|
9271
|
+
Toolbar.prototype.onLayoutChange = function () {
|
8746
9272
|
if (this.layoutBtnObj) {
|
8747
9273
|
this.layoutBtnObj.iconCss = this.parent.view === 'Details' ? ICON_GRID : ICON_LARGE;
|
8748
9274
|
var items = this.layoutBtnObj.items;
|
@@ -8756,7 +9282,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8756
9282
|
}
|
8757
9283
|
}
|
8758
9284
|
};
|
8759
|
-
Toolbar
|
9285
|
+
Toolbar.prototype.removeEventListener = function () {
|
8760
9286
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
8761
9287
|
this.parent.off(selectionChanged, this.onSelectionChanged);
|
8762
9288
|
this.parent.off(layoutChange, this.onLayoutChange);
|
@@ -8771,10 +9297,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8771
9297
|
* @returns {string} - returns module name.
|
8772
9298
|
* @private
|
8773
9299
|
*/
|
8774
|
-
Toolbar
|
9300
|
+
Toolbar.prototype.getModuleName = function () {
|
8775
9301
|
return 'toolbar';
|
8776
9302
|
};
|
8777
|
-
Toolbar
|
9303
|
+
Toolbar.prototype.onPropertyChanged = function (e) {
|
8778
9304
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
8779
9305
|
/* istanbul ignore next */
|
8780
9306
|
return;
|
@@ -8801,7 +9327,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8801
9327
|
}
|
8802
9328
|
}
|
8803
9329
|
};
|
8804
|
-
Toolbar
|
9330
|
+
Toolbar.prototype.destroy = function () {
|
8805
9331
|
if (this.parent.isDestroyed) {
|
8806
9332
|
return;
|
8807
9333
|
}
|
@@ -8815,7 +9341,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8815
9341
|
this.toolbarObj.destroy();
|
8816
9342
|
this.parent.refreshLayout();
|
8817
9343
|
};
|
8818
|
-
Toolbar
|
9344
|
+
Toolbar.prototype.enableItems = function (items, isEnable) {
|
8819
9345
|
for (var i = 0; i < items.length; i++) {
|
8820
9346
|
var ele = select('#' + this.getId(items[i]), this.parent.element);
|
8821
9347
|
if (ele) {
|
@@ -8823,7 +9349,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8823
9349
|
}
|
8824
9350
|
}
|
8825
9351
|
};
|
8826
|
-
return Toolbar
|
9352
|
+
return Toolbar;
|
8827
9353
|
}());
|
8828
9354
|
|
8829
9355
|
var Virtualization = /** @__PURE__ @class */ (function () {
|
@@ -8833,6 +9359,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8833
9359
|
}
|
8834
9360
|
/**
|
8835
9361
|
* Sets up UI virtualization for the large icon view.
|
9362
|
+
*
|
9363
|
+
* @returns {void}
|
8836
9364
|
*/
|
8837
9365
|
Virtualization.prototype.setUIVirtualization = function () {
|
8838
9366
|
// Get the current view data source
|
@@ -8858,6 +9386,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8858
9386
|
/**
|
8859
9387
|
* Sets the height of the top and bottom elements that are used for virtualization.
|
8860
9388
|
* These elements are used to give the appearance of an infinitely scrolling list.
|
9389
|
+
*
|
9390
|
+
* @returns {void}
|
8861
9391
|
*/
|
8862
9392
|
Virtualization.prototype.setUlElementHeight = function () {
|
8863
9393
|
// Calculate the number of items in the last row
|
@@ -8865,10 +9395,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8865
9395
|
(this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
|
8866
9396
|
// Create top and bottom elements
|
8867
9397
|
this.topElement = this.filemanagerInstance.createElement('div');
|
8868
|
-
this.topElement.classList.add(
|
9398
|
+
this.topElement.classList.add('e-virtual-top');
|
8869
9399
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
|
8870
9400
|
this.bottomElement = this.filemanagerInstance.createElement('div');
|
8871
|
-
this.bottomElement.classList.add(
|
9401
|
+
this.bottomElement.classList.add('e-virtual-bottom');
|
8872
9402
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
|
8873
9403
|
// Get the margin value for list items
|
8874
9404
|
var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
|
@@ -8890,17 +9420,21 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8890
9420
|
};
|
8891
9421
|
/**
|
8892
9422
|
* Calculates the number of items to display in the list based on the available width and height.
|
8893
|
-
*
|
8894
|
-
* @
|
9423
|
+
*
|
9424
|
+
* @param {number} dataSourceLength The length of the data source.
|
9425
|
+
* @returns {number} The number of items to display.
|
8895
9426
|
*/
|
8896
9427
|
Virtualization.prototype.getItemCount = function (dataSourceLength) {
|
8897
9428
|
// Get the margin values for list items
|
8898
9429
|
var widthMargin = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
|
8899
9430
|
parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
|
8900
9431
|
// Calculate the number of items that can fit in a single row
|
8901
|
-
this.rowItemCount =
|
9432
|
+
this.rowItemCount =
|
9433
|
+
Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) /
|
9434
|
+
(this.itemList[0].offsetWidth + widthMargin));
|
8902
9435
|
// Calculate the number of items that can fit in the available height
|
8903
|
-
var itemCount = this.rowItemCount *
|
9436
|
+
var itemCount = this.rowItemCount *
|
9437
|
+
(Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
|
8904
9438
|
// If the calculated item count is greater than the data source length, set the item count to the data source length
|
8905
9439
|
if (itemCount > dataSourceLength) {
|
8906
9440
|
itemCount = dataSourceLength;
|
@@ -8909,7 +9443,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8909
9443
|
};
|
8910
9444
|
/**
|
8911
9445
|
* Wires or un wires the scroll event for the list element.
|
8912
|
-
*
|
9446
|
+
*
|
9447
|
+
* @param {boolean} destroy - Set `true` to unwire the scroll event.
|
9448
|
+
* @returns {void}
|
8913
9449
|
*/
|
8914
9450
|
Virtualization.prototype.wireScrollEvent = function (destroy) {
|
8915
9451
|
if (!destroy) {
|
@@ -8924,6 +9460,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8924
9460
|
/**
|
8925
9461
|
* Handles the scroll event for the list element.
|
8926
9462
|
* This method updates the top and bottom elements and the displayed items based on the scroll position.
|
9463
|
+
*
|
9464
|
+
* @returns {void}
|
9465
|
+
* @private
|
8927
9466
|
*/
|
8928
9467
|
Virtualization.prototype.onVirtualUiScroll = function () {
|
8929
9468
|
var _a;
|
@@ -8961,14 +9500,17 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8961
9500
|
this.scrollPosition = scroll;
|
8962
9501
|
// Update the list of items and the items property of the largeIconInstance
|
8963
9502
|
this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
|
8964
|
-
this.itemCount = this.itemCount
|
9503
|
+
this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ?
|
9504
|
+
this.largeIconInstance.itemList.length : this.itemCount;
|
8965
9505
|
this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
|
8966
9506
|
this.itemCount, this.renderedCount);
|
8967
9507
|
};
|
8968
9508
|
/**
|
8969
9509
|
* Calculates the current scroll position of the list element.
|
8970
|
-
*
|
8971
|
-
* @
|
9510
|
+
*
|
9511
|
+
* @param {number} startingHeight The starting height from which to calculate the scroll position.
|
9512
|
+
* @returns {number} The current scroll position.
|
9513
|
+
* @private
|
8972
9514
|
*/
|
8973
9515
|
Virtualization.prototype.getscrollerHeight = function (startingHeight) {
|
8974
9516
|
// If the scroll position is less than or equal to the starting height, return 0.
|
@@ -8978,8 +9520,11 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8978
9520
|
};
|
8979
9521
|
/**
|
8980
9522
|
* This method updates the displayed items and the selection based on the scroll direction.
|
8981
|
-
*
|
8982
|
-
* @param
|
9523
|
+
*
|
9524
|
+
* @param {number} listDiff The number of rows to update.
|
9525
|
+
* @param {boolean} isScrollingDown If set to true, the scroll direction is downward.
|
9526
|
+
* @returns {void}
|
9527
|
+
* @private
|
8983
9528
|
*/
|
8984
9529
|
Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
|
8985
9530
|
// Update the displayed items
|
@@ -8989,7 +9534,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8989
9534
|
};
|
8990
9535
|
/**
|
8991
9536
|
* Updates the items in the large icons view.
|
8992
|
-
*
|
9537
|
+
*
|
9538
|
+
* @param {boolean} isScrollingDown - If set to true, the scroll direction is downward.
|
9539
|
+
* @returns {void}
|
9540
|
+
* @private
|
8993
9541
|
*/
|
8994
9542
|
Virtualization.prototype.updateUI = function (isScrollingDown) {
|
8995
9543
|
var _this = this;
|
@@ -9063,6 +9611,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9063
9611
|
};
|
9064
9612
|
/**
|
9065
9613
|
* Destroys the component.
|
9614
|
+
*
|
9615
|
+
* @returns {void}
|
9066
9616
|
*/
|
9067
9617
|
Virtualization.prototype.destroy = function () {
|
9068
9618
|
// If the file manager has already been destroyed, return immediately
|
@@ -9077,10 +9627,6 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9077
9627
|
return Virtualization;
|
9078
9628
|
}());
|
9079
9629
|
|
9080
|
-
/**
|
9081
|
-
* File Manager actions modules
|
9082
|
-
*/
|
9083
|
-
|
9084
9630
|
/**
|
9085
9631
|
* NavigationPane module
|
9086
9632
|
*/
|
@@ -9127,10 +9673,8 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9127
9673
|
if (!isNullOrUndefined(this.treeObj)) {
|
9128
9674
|
return;
|
9129
9675
|
}
|
9130
|
-
// eslint-disable-next-line
|
9131
9676
|
var rootData = getValue(this.parent.pathId[0], this.parent.feParent);
|
9132
9677
|
setValue('_fm_icon', 'e-fe-folder', rootData);
|
9133
|
-
// eslint-disable-next-line
|
9134
9678
|
var attr = {};
|
9135
9679
|
var id = getValue('id', rootData);
|
9136
9680
|
if (!isNullOrUndefined(id)) {
|
@@ -9202,7 +9746,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9202
9746
|
this.parent.activeElements = [dragLi];
|
9203
9747
|
this.parent.dragNodes = [];
|
9204
9748
|
getModule(this.parent, dragLi);
|
9205
|
-
// eslint-disable-next-line
|
9206
9749
|
this.parent.dragData = this.getTreeData(dragLi);
|
9207
9750
|
this.parent.dragPath = this.getDragPath(dragLi, this.parent.dragData[0].name);
|
9208
9751
|
this.parent.dragNodes.push(this.parent.dragData[0].name);
|
@@ -9226,19 +9769,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9226
9769
|
};
|
9227
9770
|
this.parent.trigger('fileLoad', eventArgs);
|
9228
9771
|
};
|
9229
|
-
// eslint-disable-next-line
|
9230
9772
|
NavigationPane.prototype.addChild = function (files, target, prevent) {
|
9231
|
-
// eslint-disable-next-line
|
9232
9773
|
var directories = getDirectories(files);
|
9233
|
-
|
9234
|
-
|
9774
|
+
var targetDirectory = this.getTreeData(target);
|
9775
|
+
if (directories.length > 0 && targetDirectory.length > 0 &&
|
9776
|
+
(directories[0].filterPath == null ||
|
9777
|
+
isNullOrUndefined(targetDirectory[0])
|
9778
|
+
&& targetDirectory[0].filterPath == null
|
9779
|
+
|| directories[0].filterPath !==
|
9780
|
+
targetDirectory[0].filterPath)) {
|
9235
9781
|
var length_1 = 0;
|
9236
|
-
// eslint-disable-next-line
|
9237
9782
|
var folders = directories;
|
9238
9783
|
while (length_1 < directories.length) {
|
9239
|
-
// eslint-disable-next-line
|
9240
|
-
folders[length_1]._fm_icon = 'e-fe-folder';
|
9241
|
-
// eslint-disable-next-line
|
9784
|
+
// eslint-disable-next-line camelcase
|
9785
|
+
folders[parseInt(length_1.toString(), 10)]._fm_icon = 'e-fe-folder';
|
9242
9786
|
var attr = {};
|
9243
9787
|
var id = getValue('id', folders[length_1]);
|
9244
9788
|
if (!isNullOrUndefined(id)) {
|
@@ -9255,21 +9799,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9255
9799
|
var element = select('[data-uid="' + target + '"]', this.treeObj.element);
|
9256
9800
|
var childElements = select('ul', element);
|
9257
9801
|
if (isNullOrUndefined(childElements)) {
|
9258
|
-
// eslint-disable-next-line
|
9259
9802
|
this.treeObj.addNodes(directories, target, null, prevent);
|
9260
9803
|
}
|
9261
9804
|
}
|
9262
9805
|
};
|
9263
9806
|
// Node Selecting event handler
|
9264
9807
|
NavigationPane.prototype.onNodeSelecting = function (args) {
|
9265
|
-
if (!args.isInteracted && !this.isRightClick &&
|
9808
|
+
if (!args.isInteracted && !this.isRightClick &&
|
9809
|
+
!this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
|
9266
9810
|
this.restrictSelecting = false;
|
9267
9811
|
this.isNodeClickCalled = false;
|
9268
9812
|
return;
|
9269
9813
|
}
|
9270
9814
|
if (!this.renameParent) {
|
9271
9815
|
this.parent.activeModule = 'navigationpane';
|
9272
|
-
// eslint-disable-next-line
|
9273
9816
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9274
9817
|
if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked) {
|
9275
9818
|
this.isNodeClickCalled = false;
|
@@ -9288,7 +9831,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9288
9831
|
this.isNodeClickCalled = true;
|
9289
9832
|
this.isSameNodeClicked = false;
|
9290
9833
|
this.previousSelected = this.treeObj.selectedNodes;
|
9291
|
-
this.treeObj.selectedNodes = [args.node.getAttribute(
|
9834
|
+
this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
|
9292
9835
|
}
|
9293
9836
|
}
|
9294
9837
|
else if (this.previousSelected[0] !== args.node.getAttribute('data-uid')) {
|
@@ -9300,7 +9843,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9300
9843
|
// Opens the folder while clicking open context menu item in the treeview.
|
9301
9844
|
NavigationPane.prototype.openFileOnContextMenuClick = function (node) {
|
9302
9845
|
var data = this.treeObj.getTreeData(node);
|
9303
|
-
// eslint-disable-next-line
|
9304
9846
|
this.parent.selectedItems = [];
|
9305
9847
|
this.parent.itemData = data;
|
9306
9848
|
this.activeNode = node;
|
@@ -9329,7 +9871,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9329
9871
|
}
|
9330
9872
|
this.activeNode = args.node;
|
9331
9873
|
this.parent.activeModule = 'navigationpane';
|
9332
|
-
// eslint-disable-next-line
|
9333
9874
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9334
9875
|
this.parent.selectedItems = [];
|
9335
9876
|
this.parent.itemData = nodeData;
|
@@ -9354,7 +9895,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9354
9895
|
this.isPathDragged = this.isRenameParent = this.isRightClick = this.isSameNodeClicked = false;
|
9355
9896
|
};
|
9356
9897
|
/* istanbul ignore next */
|
9357
|
-
// eslint-disable-next-line
|
9358
9898
|
NavigationPane.prototype.onPathDrag = function (args) {
|
9359
9899
|
this.isPathDragged = true;
|
9360
9900
|
this.selectResultNode(args[0]);
|
@@ -9365,6 +9905,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9365
9905
|
return;
|
9366
9906
|
}
|
9367
9907
|
if (args.node.querySelector('.' + LIST_ITEM) === null) {
|
9908
|
+
this.isNodeExpandCalled = true;
|
9368
9909
|
var text = getValue('text', args.nodeData);
|
9369
9910
|
var id = args.node.getAttribute('data-id');
|
9370
9911
|
var isId = isNullOrUndefined(id) ? false : true;
|
@@ -9375,7 +9916,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9375
9916
|
this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
|
9376
9917
|
this.parent.pathId.push(getValue('id', args.nodeData));
|
9377
9918
|
read(this.parent, nodeExpand, path);
|
9378
|
-
this.isNodeExpandCalled = true;
|
9379
9919
|
}
|
9380
9920
|
};
|
9381
9921
|
/* istanbul ignore next */
|
@@ -9415,7 +9955,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9415
9955
|
};
|
9416
9956
|
NavigationPane.prototype.onPathChanged = function (args) {
|
9417
9957
|
this.parent.isCut = false;
|
9418
|
-
// eslint-disable-next-line
|
9419
9958
|
var currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
|
9420
9959
|
if (this.expandNodeTarget === 'add') {
|
9421
9960
|
var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
|
@@ -9520,14 +10059,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9520
10059
|
this.renameParent = null;
|
9521
10060
|
}
|
9522
10061
|
else {
|
9523
|
-
// eslint-disable-next-line
|
9524
10062
|
var resultData = [];
|
9525
10063
|
if (this.parent.hasId) {
|
9526
10064
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9527
10065
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9528
10066
|
}
|
9529
10067
|
else {
|
9530
|
-
// eslint-disable-next-line
|
9531
10068
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9532
10069
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.renameText, false));
|
9533
10070
|
if (nData.length > 0) {
|
@@ -9548,16 +10085,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9548
10085
|
this.updateTree(args);
|
9549
10086
|
}
|
9550
10087
|
else {
|
9551
|
-
// eslint-disable-next-line
|
9552
10088
|
var data = this.treeObj.getTreeData();
|
9553
|
-
// eslint-disable-next-line
|
9554
10089
|
var resultData = [];
|
9555
10090
|
if (this.parent.hasId) {
|
9556
10091
|
resultData = new DataManager(data).
|
9557
10092
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9558
10093
|
}
|
9559
10094
|
else {
|
9560
|
-
// eslint-disable-next-line
|
9561
10095
|
var nData = new DataManager(data).
|
9562
10096
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.currentItemText, false));
|
9563
10097
|
if (nData.length > 0) {
|
@@ -9613,7 +10147,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9613
10147
|
}
|
9614
10148
|
this.treeObj.removeNodes(moveNames);
|
9615
10149
|
};
|
9616
|
-
// eslint-disable-next-line
|
9617
10150
|
NavigationPane.prototype.getMoveNames = function (files, flag, path) {
|
9618
10151
|
var moveNames = [];
|
9619
10152
|
for (var i = 0; i < files.length; i++) {
|
@@ -9626,7 +10159,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9626
10159
|
name_2 = path.substring(index + 1);
|
9627
10160
|
path = path.substring(0, index + 1);
|
9628
10161
|
}
|
9629
|
-
// eslint-disable-next-line
|
9630
10162
|
var resultData = new DataManager(this.treeObj.getTreeData()).
|
9631
10163
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', name_2, false));
|
9632
10164
|
for (var j = 0; j < resultData.length; j++) {
|
@@ -9653,16 +10185,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9653
10185
|
this.treeObj.removeNodes(moveNames);
|
9654
10186
|
};
|
9655
10187
|
/* istanbul ignore next */
|
9656
|
-
// eslint-disable-next-line
|
9657
10188
|
NavigationPane.prototype.selectResultNode = function (resultObj) {
|
9658
10189
|
if (!this.parent.hasId) {
|
9659
10190
|
var path = getValue('filterPath', resultObj);
|
9660
10191
|
var itemname = getValue('name', resultObj);
|
9661
|
-
// eslint-disable-next-line
|
9662
10192
|
var data = new DataManager(this.treeObj.getTreeData()).
|
9663
10193
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', itemname, false));
|
9664
10194
|
if (data.length > 0) {
|
9665
|
-
// eslint-disable-next-line
|
9666
10195
|
var resultData = new DataManager(data).
|
9667
10196
|
executeLocal(new Query().where('filterPath', 'equal', path, false));
|
9668
10197
|
if (resultData.length > 0) {
|
@@ -9684,14 +10213,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9684
10213
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9685
10214
|
};
|
9686
10215
|
NavigationPane.prototype.onpasteEnd = function (args) {
|
9687
|
-
// eslint-disable-next-line
|
9688
10216
|
var resultData = [];
|
9689
10217
|
if (this.parent.hasId) {
|
9690
10218
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9691
10219
|
executeLocal(new Query().where('id', 'equal', getValue('id', args.cwd), false));
|
9692
10220
|
}
|
9693
10221
|
else {
|
9694
|
-
// eslint-disable-next-line
|
9695
10222
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9696
10223
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', getValue('name', args.cwd), false));
|
9697
10224
|
if (nData.length > 0) {
|
@@ -9713,6 +10240,9 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9713
10240
|
};
|
9714
10241
|
/* istanbul ignore next */
|
9715
10242
|
NavigationPane.prototype.checkDropPath = function (args) {
|
10243
|
+
if (isFileSystemData(this.parent) && this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane') {
|
10244
|
+
return;
|
10245
|
+
}
|
9716
10246
|
if (this.parent.hasId) {
|
9717
10247
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9718
10248
|
readDropPath(this.parent);
|
@@ -9731,8 +10261,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9731
10261
|
this.updateItemData();
|
9732
10262
|
}
|
9733
10263
|
this.moveNames = [];
|
9734
|
-
|
9735
|
-
var obj = this.parent.isDragDrop ? this.parent.dragData : this.parent.actionRecords;
|
10264
|
+
var obj = this.parent.isDragDrop || isFileSystemData(this.parent) ? this.parent.dragData : this.parent.actionRecords;
|
9736
10265
|
for (var i = 0; i < obj.length; i++) {
|
9737
10266
|
if (getValue('isFile', obj[i]) === false) {
|
9738
10267
|
this.moveNames.push(getValue('_fm_id', obj[i]));
|
@@ -9812,12 +10341,10 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9812
10341
|
/* istanbul ignore next */
|
9813
10342
|
NavigationPane.prototype.onDetailsInit = function () {
|
9814
10343
|
if (this.parent.activeModule === this.getModuleName()) {
|
9815
|
-
// eslint-disable-next-line
|
9816
10344
|
var dataobj = this.getTreeData(this.treeObj.selectedNodes[0]);
|
9817
10345
|
this.parent.itemData = dataobj;
|
9818
10346
|
}
|
9819
10347
|
};
|
9820
|
-
// eslint-disable-next-line
|
9821
10348
|
NavigationPane.prototype.onMenuItemData = function (args) {
|
9822
10349
|
if (this.parent.activeModule === this.getModuleName()) {
|
9823
10350
|
var liEle = closest(args.target, 'li');
|
@@ -9915,7 +10442,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9915
10442
|
break;
|
9916
10443
|
case 'f2':
|
9917
10444
|
if (this.parent.selectedItems.length === 0) {
|
9918
|
-
// eslint-disable-next-line
|
9919
10445
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9920
10446
|
if (!hasEditAccess(data)) {
|
9921
10447
|
createDeniedDialog(this.parent, data, permissionEdit);
|
@@ -9928,9 +10454,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9928
10454
|
break;
|
9929
10455
|
}
|
9930
10456
|
};
|
9931
|
-
// eslint-disable-next-line
|
9932
10457
|
NavigationPane.prototype.getTreeData = function (args) {
|
9933
|
-
// eslint-disable-next-line
|
9934
10458
|
var data = this.treeObj.getTreeData(args);
|
9935
10459
|
for (var i = 0; i < data.length; i++) {
|
9936
10460
|
if (isNullOrUndefined(getValue('hasChild', data[i]))) {
|
@@ -9944,7 +10468,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9944
10468
|
this.parent.currentItemText = getValue('name', this.parent.itemData[0]);
|
9945
10469
|
};
|
9946
10470
|
NavigationPane.prototype.updateItemData = function () {
|
9947
|
-
// eslint-disable-next-line
|
9948
10471
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9949
10472
|
this.parent.itemData = [data];
|
9950
10473
|
this.parent.isFile = false;
|
@@ -9966,6 +10489,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9966
10489
|
return NavigationPane;
|
9967
10490
|
}());
|
9968
10491
|
|
10492
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9969
10493
|
/**
|
9970
10494
|
* DetailsView module
|
9971
10495
|
*/
|
@@ -9992,7 +10516,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
9992
10516
|
this.isNameWidth = false;
|
9993
10517
|
this.pasteOperation = false;
|
9994
10518
|
this.uploadOperation = false;
|
9995
|
-
Grid.Inject(Resize, ContextMenu$
|
10519
|
+
Grid.Inject(Resize, ContextMenu$2, Sort, VirtualScroll);
|
9996
10520
|
this.parent = parent;
|
9997
10521
|
this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
|
9998
10522
|
this.addEventListener();
|
@@ -10039,7 +10563,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10039
10563
|
showSpinner(this.parent.element);
|
10040
10564
|
if (this.parent.view === 'Details') {
|
10041
10565
|
removeClass([this.parent.element], MULTI_SELECT);
|
10042
|
-
// eslint-disable-next-line
|
10043
10566
|
var items = getSortedData(this.parent, args.files);
|
10044
10567
|
this.checkNameWidth();
|
10045
10568
|
var columns = this.getColumns();
|
@@ -10080,8 +10603,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10080
10603
|
width: '100%',
|
10081
10604
|
height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
|
10082
10605
|
beforeCopy: function (args) { args.cancel = true; },
|
10083
|
-
|
10084
|
-
load: function (args) {
|
10606
|
+
load: function () {
|
10085
10607
|
this.focusModule.destroy();
|
10086
10608
|
},
|
10087
10609
|
locale: this.parent.locale
|
@@ -10099,18 +10621,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10099
10621
|
}
|
10100
10622
|
};
|
10101
10623
|
DetailsView.prototype.reactTemplateRender = function (args) {
|
10102
|
-
this.parent[
|
10624
|
+
this.parent['portals'] = args;
|
10103
10625
|
if (this.parent.portals && this.parent.toolbarModule && this.parent.toolbarModule.toolbarObj &&
|
10104
10626
|
this.parent.toolbarModule.toolbarObj.portals) {
|
10105
|
-
this.parent[
|
10627
|
+
this.parent['portals'] = this.parent['portals'].concat(this.parent.toolbarModule.toolbarObj.portals);
|
10106
10628
|
}
|
10107
|
-
this.parent.notify('renderReactTemplate', this.parent[
|
10108
|
-
this.parent[
|
10629
|
+
this.parent.notify('renderReactTemplate', this.parent['portals']);
|
10630
|
+
this.parent['renderReactTemplates']();
|
10109
10631
|
};
|
10110
10632
|
/**
|
10111
10633
|
* Gets the grid height.
|
10112
10634
|
*
|
10113
|
-
* @returns The grid height.
|
10635
|
+
* @returns {number} - The grid height.
|
10114
10636
|
* @private
|
10115
10637
|
*/
|
10116
10638
|
DetailsView.prototype.getGridHeight = function () {
|
@@ -10188,7 +10710,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10188
10710
|
return "<span class=\"e-fe-icon " + data._fm_iconClass + "\"></span>";
|
10189
10711
|
}), allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
|
10190
10712
|
headerTemplate: initializeCSPTemplate(function () {
|
10191
|
-
return
|
10713
|
+
return '<span class=\'e-fe-icon e-fe-folder\'></span>';
|
10192
10714
|
})
|
10193
10715
|
};
|
10194
10716
|
columns.unshift(icon);
|
@@ -10247,7 +10769,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10247
10769
|
}
|
10248
10770
|
}
|
10249
10771
|
if (!this.parent.showFileExtension && getValue('isFile', args.data)) {
|
10250
|
-
var
|
10772
|
+
var text = getValue('name', args.data);
|
10773
|
+
var textEle = args.row.querySelector('[title= "' + text + '"]');
|
10251
10774
|
if (textEle) {
|
10252
10775
|
var name_1 = getValue('name', args.data);
|
10253
10776
|
var type = getValue('type', args.data);
|
@@ -10281,7 +10804,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10281
10804
|
var dateEle = args.row.querySelector('.e-fe-date');
|
10282
10805
|
var intl = new Internationalization(this.parent.locale);
|
10283
10806
|
var columns = this.parent.detailsViewSettings.columns;
|
10284
|
-
// eslint-disable-next-line
|
10285
10807
|
var format = void 0;
|
10286
10808
|
for (var i = 0; i < columns.length; i++) {
|
10287
10809
|
if (columns[i].field === 'dateModified') {
|
@@ -10317,7 +10839,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10317
10839
|
var len = rows.length;
|
10318
10840
|
this.sortSelectedNodes = [];
|
10319
10841
|
while (len > 0) {
|
10320
|
-
// eslint-disable-next-line
|
10321
10842
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
10322
10843
|
this.sortSelectedNodes.push(getValue(this.parent.hasId ? 'id' : 'name', data));
|
10323
10844
|
len--;
|
@@ -10337,8 +10858,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10337
10858
|
showSpinner(this.parent.element);
|
10338
10859
|
var nameColumn = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === _this.parent.sortBy; });
|
10339
10860
|
if (nameColumn && !('sortComparer' in nameColumn)) {
|
10340
|
-
|
10341
|
-
|
10861
|
+
var items = getSortedData(this.parent, (this.parent.enableVirtualization)
|
10862
|
+
? args.result
|
10863
|
+
: this.gridObj.dataSource);
|
10342
10864
|
args.result = items;
|
10343
10865
|
}
|
10344
10866
|
};
|
@@ -10347,7 +10869,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10347
10869
|
this.createDragObj();
|
10348
10870
|
if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
|
10349
10871
|
((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
|
10350
|
-
this.element.querySelector('.e-content').scrollTop
|
10872
|
+
this.element.querySelector('.e-content').scrollTop === 0))) {
|
10351
10873
|
this.selectRecords(this.parent.selectedItems);
|
10352
10874
|
}
|
10353
10875
|
if (this.isPasteOperation === true) {
|
@@ -10420,7 +10942,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10420
10942
|
this.isLoaded = false;
|
10421
10943
|
};
|
10422
10944
|
DetailsView.prototype.selectRecords = function (nodes) {
|
10423
|
-
// eslint-disable-next-line
|
10424
10945
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
10425
10946
|
var sRecords = [];
|
10426
10947
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
@@ -10428,7 +10949,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10428
10949
|
if (nodes.indexOf(node) !== -1) {
|
10429
10950
|
sRecords.push(i);
|
10430
10951
|
}
|
10431
|
-
else if (!this.parent.showFileExtension && node.includes('.')) {
|
10952
|
+
else if (!this.parent.showFileExtension && !this.parent.hasId && node.includes('.')) {
|
10432
10953
|
var Str2 = node.split('.').slice(0, -1).join('.');
|
10433
10954
|
if (nodes.indexOf(Str2) !== -1) {
|
10434
10955
|
sRecords.push(i);
|
@@ -10440,18 +10961,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10440
10961
|
this.addFocus(this.gridObj.selectedRowIndex);
|
10441
10962
|
}
|
10442
10963
|
};
|
10443
|
-
// eslint-disable-next-line
|
10444
10964
|
DetailsView.prototype.addSelection = function (data) {
|
10445
|
-
// eslint-disable-next-line
|
10446
10965
|
var items = this.gridObj.getCurrentViewRecords();
|
10447
|
-
// eslint-disable-next-line
|
10448
10966
|
var rData = [];
|
10449
10967
|
if (this.parent.hasId) {
|
10450
10968
|
rData = new DataManager(items).
|
10451
10969
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
10452
10970
|
}
|
10453
10971
|
else {
|
10454
|
-
// eslint-disable-next-line
|
10455
10972
|
var nData = new DataManager(items).
|
10456
10973
|
executeLocal(new Query().where('name', 'equal', getValue('name', data), false));
|
10457
10974
|
if (nData.length > 0) {
|
@@ -10469,7 +10986,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10469
10986
|
this.gridObj.sortModule.sortColumn(this.parent.sortBy, this.parent.sortOrder);
|
10470
10987
|
}
|
10471
10988
|
else {
|
10472
|
-
// eslint-disable-next-line
|
10473
10989
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10474
10990
|
}
|
10475
10991
|
if (this.element.querySelector('.e-content').scrollTop !== 0) {
|
@@ -10566,10 +11082,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10566
11082
|
var len = this.gridObj.columns.length;
|
10567
11083
|
var columnData = JSON.parse(JSON.stringify(this.gridObj.columns));
|
10568
11084
|
if (columnData[len - 1].field && columnData[len - 1].field !== 'filterPath' && !this.parent.isMobile) {
|
10569
|
-
var pathColumn
|
11085
|
+
var pathColumn = {
|
10570
11086
|
field: 'filterPath', headerText: getLocaleText(this.parent, 'Path'), minWidth: 180, width: 'auto'
|
10571
11087
|
};
|
10572
|
-
this.gridObj.columns.push(pathColumn
|
11088
|
+
this.gridObj.columns.push(pathColumn);
|
10573
11089
|
this.adjustWidth(this.gridObj.columns, 'filterPath');
|
10574
11090
|
this.adjustWidth(this.gridObj.columns, 'name');
|
10575
11091
|
this.isColumnRefresh = true;
|
@@ -10577,7 +11093,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10577
11093
|
}
|
10578
11094
|
};
|
10579
11095
|
DetailsView.prototype.checkEmptyDiv = function (args) {
|
10580
|
-
// eslint-disable-next-line
|
10581
11096
|
var items = getSortedData(this.parent, args.files);
|
10582
11097
|
if (items.length === 0 && !isNullOrUndefined(this.element.querySelector('.' + GRID_VIEW))) {
|
10583
11098
|
createEmptyElement(this.parent, this.element, args);
|
@@ -10594,21 +11109,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10594
11109
|
};
|
10595
11110
|
DetailsView.prototype.onOpenInit = function () {
|
10596
11111
|
if (this.parent.activeModule === 'detailsview') {
|
10597
|
-
// eslint-disable-next-line
|
10598
11112
|
var data = this.gridObj.getSelectedRecords()[0];
|
10599
11113
|
this.openContent(data);
|
10600
11114
|
}
|
10601
11115
|
};
|
10602
11116
|
DetailsView.prototype.DblClickEvents = function (args) {
|
10603
11117
|
this.gridObj.selectRows([args.rowIndex]);
|
10604
|
-
// eslint-disable-next-line
|
10605
11118
|
var data;
|
10606
11119
|
if (args.rowData) {
|
10607
11120
|
data = JSON.parse(JSON.stringify(args.rowData));
|
10608
11121
|
this.openContent(data);
|
10609
11122
|
}
|
10610
11123
|
};
|
10611
|
-
// eslint-disable-next-line
|
10612
11124
|
DetailsView.prototype.openContent = function (data) {
|
10613
11125
|
var _this = this;
|
10614
11126
|
if (!hasReadAccess(data)) {
|
@@ -10705,7 +11217,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10705
11217
|
this.gridObj.sortColumn('name', this.parent.sortOrder);
|
10706
11218
|
}
|
10707
11219
|
else {
|
10708
|
-
// eslint-disable-next-line
|
10709
11220
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10710
11221
|
}
|
10711
11222
|
this.parent.notify(sortByChange, {});
|
@@ -10894,7 +11405,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10894
11405
|
this.parent.off(updateSelectionData, this.onUpdateSelectionData);
|
10895
11406
|
};
|
10896
11407
|
DetailsView.prototype.onActionFailure = function () { this.interaction = true; };
|
10897
|
-
// eslint-disable-next-line
|
10898
11408
|
DetailsView.prototype.onMenuItemData = function (args) {
|
10899
11409
|
if (this.parent.activeModule === this.getModuleName()) {
|
10900
11410
|
this.parent.itemData = [this.gridObj.getRowInfo(args.target).rowData];
|
@@ -10935,7 +11445,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10935
11445
|
getModule(this.parent, dragLi);
|
10936
11446
|
this.parent.activeElements = [];
|
10937
11447
|
this.parent.dragData = [];
|
10938
|
-
// eslint-disable-next-line
|
10939
11448
|
this.parent.dragData = this.gridObj.getSelectedRecords();
|
10940
11449
|
var dragRow;
|
10941
11450
|
if (this.parent.dragData.length === 0 && dragLi) {
|
@@ -11024,16 +11533,13 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11024
11533
|
DetailsView.prototype.onDropInit = function (args) {
|
11025
11534
|
if (this.parent.targetModule === this.getModuleName()) {
|
11026
11535
|
/* istanbul ignore next */
|
11027
|
-
// eslint-disable-next-line
|
11028
11536
|
var cwdData = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feParent);
|
11029
11537
|
if (!args.target.closest('tr')) {
|
11030
11538
|
this.parent.dropPath = this.parent.path;
|
11031
11539
|
this.parent.dropData = cwdData;
|
11032
11540
|
}
|
11033
11541
|
else {
|
11034
|
-
// eslint-disable-next-line
|
11035
11542
|
var info = null;
|
11036
|
-
// eslint-disable-next-line
|
11037
11543
|
info = this.gridObj.getRowInfo(args.target).rowData;
|
11038
11544
|
this.parent.dropPath = info.isFile ? this.parent.path : getFullPath(this.parent, info, this.parent.path);
|
11039
11545
|
this.parent.dropData = info.isFile ? cwdData : info;
|
@@ -11135,7 +11641,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11135
11641
|
this.parent.currentItemText = getValue('name', args.data);
|
11136
11642
|
}
|
11137
11643
|
else if (len > 0) {
|
11138
|
-
// eslint-disable-next-line
|
11139
11644
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
11140
11645
|
this.parent.currentItemText = getValue('name', data);
|
11141
11646
|
}
|
@@ -11165,7 +11670,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11165
11670
|
};
|
11166
11671
|
DetailsView.prototype.selectedRecords = function () {
|
11167
11672
|
this.parent.setProperties({ selectedItems: [] }, true);
|
11168
|
-
// eslint-disable-next-line
|
11169
11673
|
var selectedRecords = this.gridSelectNodes();
|
11170
11674
|
var selectSize = 0;
|
11171
11675
|
while (selectSize < selectedRecords.length) {
|
@@ -11229,28 +11733,27 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11229
11733
|
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
11230
11734
|
};
|
11231
11735
|
DetailsView.prototype.wireClickEvent = function (toBind) {
|
11736
|
+
var _this = this;
|
11232
11737
|
if (toBind) {
|
11233
|
-
// eslint-disable-next-line
|
11234
|
-
var proxy_1 = this;
|
11235
11738
|
var ele = this.gridObj.getContent();
|
11236
11739
|
this.clickObj = new Touch(ele, {
|
11237
11740
|
tap: function (eve) {
|
11238
11741
|
if (eve.tapCount === 1 && eve.originalEvent.target.classList.contains('e-content')) {
|
11239
|
-
|
11742
|
+
_this.onClearAllInit();
|
11240
11743
|
}
|
11241
11744
|
},
|
11242
11745
|
tapHold: function (e) {
|
11243
|
-
if (
|
11746
|
+
if (_this.parent.isDevice) {
|
11244
11747
|
e.originalEvent.preventDefault();
|
11245
|
-
if (
|
11246
|
-
setValue('enableSelectMultiTouch',
|
11247
|
-
addClass([
|
11748
|
+
if (_this.parent.allowMultiSelection) {
|
11749
|
+
setValue('enableSelectMultiTouch', _this.parent.allowMultiSelection, _this.gridObj.selectionModule);
|
11750
|
+
addClass([_this.parent.element], MULTI_SELECT);
|
11248
11751
|
}
|
11249
11752
|
var target = e.originalEvent.target;
|
11250
11753
|
if (target) {
|
11251
11754
|
var row = closest(target, '.' + ROW);
|
11252
|
-
var index =
|
11253
|
-
|
11755
|
+
var index = _this.gridObj.getRows().indexOf(row);
|
11756
|
+
_this.gridObj.selectRow(index);
|
11254
11757
|
}
|
11255
11758
|
}
|
11256
11759
|
}
|
@@ -11294,7 +11797,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11294
11797
|
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
11295
11798
|
};
|
11296
11799
|
/* istanbul ignore next */
|
11297
|
-
// eslint:disable-next-line
|
11298
11800
|
DetailsView.prototype.keydownHandler = function (e) {
|
11299
11801
|
if (!this.isRendered) {
|
11300
11802
|
return;
|
@@ -11333,26 +11835,20 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11333
11835
|
case 'ctrlD':
|
11334
11836
|
e.preventDefault();
|
11335
11837
|
break;
|
11336
|
-
default:
|
11337
|
-
break;
|
11338
11838
|
}
|
11339
11839
|
};
|
11340
11840
|
/* istanbul ignore next */
|
11341
|
-
// eslint:disable-next-line
|
11342
11841
|
DetailsView.prototype.keyupHandler = function (e) {
|
11343
11842
|
if (!this.isRendered) {
|
11344
11843
|
return;
|
11345
11844
|
}
|
11346
11845
|
e.preventDefault();
|
11347
11846
|
var action = e.action;
|
11348
|
-
// eslint-disable-next-line
|
11349
11847
|
var gridItems = getSortedData(this.parent, this.gridObj.dataSource);
|
11350
11848
|
var gridLength = gridItems.length;
|
11351
|
-
var focItem = this.getFocusedItem();
|
11352
11849
|
var focIndex = this.getFocusedItemIndex();
|
11353
11850
|
var selIndex = this.gridObj.selectedRowIndex;
|
11354
11851
|
var selRowIndeces = this.gridObj.getSelectedRowIndexes();
|
11355
|
-
// eslint-disable-next-line
|
11356
11852
|
var rowData;
|
11357
11853
|
var firstItem;
|
11358
11854
|
var lastItem;
|
@@ -11382,7 +11878,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11382
11878
|
}
|
11383
11879
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
11384
11880
|
if (rowData) {
|
11385
|
-
// eslint-disable-next-line
|
11386
11881
|
var data = JSON.parse(JSON.stringify(rowData));
|
11387
11882
|
this.openContent(data);
|
11388
11883
|
}
|
@@ -11499,14 +11994,12 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11499
11994
|
break;
|
11500
11995
|
}
|
11501
11996
|
};
|
11502
|
-
// eslint-disable-next-line
|
11503
11997
|
DetailsView.prototype.gridSelectNodes = function () {
|
11504
11998
|
return this.gridObj.getSelectedRecords();
|
11505
11999
|
};
|
11506
12000
|
DetailsView.prototype.doDownload = function () {
|
11507
12001
|
if (this.parent.selectedItems.length !== 0) {
|
11508
12002
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11509
|
-
// eslint-disable-next-line
|
11510
12003
|
var items = this.parent.itemData;
|
11511
12004
|
for (var i = 0; i < items.length; i++) {
|
11512
12005
|
if (!hasDownloadAccess(items[i])) {
|
@@ -11520,7 +12013,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11520
12013
|
DetailsView.prototype.performDelete = function () {
|
11521
12014
|
if (this.parent.selectedItems && this.parent.selectedItems.length > 0) {
|
11522
12015
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11523
|
-
// eslint-disable-next-line
|
11524
12016
|
var items = this.parent.itemData;
|
11525
12017
|
for (var i = 0; i < items.length; i++) {
|
11526
12018
|
if (!hasEditAccess(items[i])) {
|
@@ -11538,11 +12030,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11538
12030
|
}
|
11539
12031
|
};
|
11540
12032
|
DetailsView.prototype.updateRenameData = function () {
|
11541
|
-
// eslint-disable-next-line
|
11542
12033
|
var data = this.gridSelectNodes()[0];
|
11543
12034
|
updateRenamingData(this.parent, data);
|
11544
12035
|
};
|
11545
|
-
// eslint-disable-next-line
|
11546
12036
|
DetailsView.prototype.shiftMoveMethod = function (gridItems, selIndex, focIndex, selRowIndeces, e) {
|
11547
12037
|
if (!this.parent.allowMultiSelection) {
|
11548
12038
|
this.moveFunction(gridItems, e, selIndex);
|
@@ -11560,7 +12050,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11560
12050
|
}
|
11561
12051
|
}
|
11562
12052
|
};
|
11563
|
-
// eslint-disable-next-line
|
11564
12053
|
DetailsView.prototype.moveFunction = function (selectedItems, e, rowIndex) {
|
11565
12054
|
if (!isNullOrUndefined(this.getFocusedItem()) && this.parent.allowMultiSelection) {
|
11566
12055
|
if (e.action === 'moveDown') {
|
@@ -11607,7 +12096,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11607
12096
|
this.gridObj.selectRow(selIndex);
|
11608
12097
|
}
|
11609
12098
|
};
|
11610
|
-
// eslint-disable-next-line
|
11611
12099
|
DetailsView.prototype.ctrlMoveFunction = function (items, e, rowIndex) {
|
11612
12100
|
var nextItem;
|
11613
12101
|
if (!isNullOrUndefined(this.getFocusedItem())) {
|
@@ -11626,7 +12114,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11626
12114
|
}
|
11627
12115
|
this.addFocus(nextItem);
|
11628
12116
|
};
|
11629
|
-
// eslint-disable-next-line
|
11630
12117
|
DetailsView.prototype.checkRowsKey = function (items, indexValue, focIndex, e) {
|
11631
12118
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
11632
12119
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
@@ -11750,7 +12237,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11750
12237
|
}
|
11751
12238
|
return check;
|
11752
12239
|
};
|
11753
|
-
// eslint-disable-next-line
|
11754
12240
|
DetailsView.prototype.shiftSelectedItem = function (selIndex, selRowIndexes, gridItems, e) {
|
11755
12241
|
if (selIndex === -1) {
|
11756
12242
|
this.gridObj.selectRow(0);
|
@@ -11799,7 +12285,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11799
12285
|
}
|
11800
12286
|
}
|
11801
12287
|
};
|
11802
|
-
// eslint-disable-next-line
|
11803
12288
|
DetailsView.prototype.onMethodCall = function (e) {
|
11804
12289
|
if (this.parent.view !== 'Details') {
|
11805
12290
|
return;
|
@@ -11832,17 +12317,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11832
12317
|
break;
|
11833
12318
|
}
|
11834
12319
|
};
|
11835
|
-
// eslint-disable-next-line
|
11836
12320
|
DetailsView.prototype.getRecords = function (nodes) {
|
11837
|
-
// eslint-disable-next-line
|
11838
12321
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
11839
|
-
// eslint-disable-next-line
|
11840
12322
|
var records = [];
|
11841
12323
|
var hasFilter = (this.parent.breadcrumbbarModule.searchObj.element.value !== '' || this.parent.isFiltered) ? true : false;
|
11842
|
-
var filter
|
12324
|
+
var filter = this.parent.hasId ? 'id' : 'name';
|
11843
12325
|
if (this.parent.hasId || !hasFilter) {
|
11844
12326
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
11845
|
-
if (nodes.indexOf(getValue(filter
|
12327
|
+
if (nodes.indexOf(getValue(filter, gridRecords[i])) !== -1) {
|
11846
12328
|
records.push(gridRecords[i]);
|
11847
12329
|
}
|
11848
12330
|
}
|
@@ -11863,12 +12345,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11863
12345
|
this.performDelete();
|
11864
12346
|
return;
|
11865
12347
|
}
|
11866
|
-
// eslint-disable-next-line
|
11867
12348
|
var records = this.getRecords(ids);
|
11868
12349
|
if (records.length === 0) {
|
11869
12350
|
return;
|
11870
12351
|
}
|
11871
|
-
// eslint-disable-next-line
|
11872
12352
|
var data = [];
|
11873
12353
|
var newIds = [];
|
11874
12354
|
for (var i = 0; i < records.length; i++) {
|
@@ -11882,12 +12362,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11882
12362
|
this.doDownload();
|
11883
12363
|
return;
|
11884
12364
|
}
|
11885
|
-
// eslint-disable-next-line
|
11886
12365
|
var dRecords = this.getRecords(ids);
|
11887
12366
|
if (dRecords.length === 0) {
|
11888
12367
|
return;
|
11889
12368
|
}
|
11890
|
-
// eslint-disable-next-line
|
11891
12369
|
var data = [];
|
11892
12370
|
var newIds = [];
|
11893
12371
|
for (var i = 0; i < dRecords.length; i++) {
|
@@ -11900,7 +12378,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11900
12378
|
if (isNullOrUndefined(id)) {
|
11901
12379
|
return;
|
11902
12380
|
}
|
11903
|
-
// eslint-disable-next-line
|
11904
12381
|
var records = this.getRecords([id]);
|
11905
12382
|
if (records.length > 0) {
|
11906
12383
|
this.openContent(records[0]);
|
@@ -11912,7 +12389,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11912
12389
|
this.performRename();
|
11913
12390
|
return;
|
11914
12391
|
}
|
11915
|
-
// eslint-disable-next-line
|
11916
12392
|
var records = this.getRecords([id]);
|
11917
12393
|
if (records.length > 0) {
|
11918
12394
|
updateRenamingData(this.parent, records[0]);
|
@@ -11932,21 +12408,5 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11932
12408
|
return DetailsView;
|
11933
12409
|
}());
|
11934
12410
|
|
11935
|
-
|
11936
|
-
* File Manager layout modules
|
11937
|
-
*/
|
11938
|
-
|
11939
|
-
/**
|
11940
|
-
* File Manager pop-up modules
|
11941
|
-
*/
|
11942
|
-
|
11943
|
-
/**
|
11944
|
-
* File Manager modules
|
11945
|
-
*/
|
11946
|
-
|
11947
|
-
/**
|
11948
|
-
* File Manager all modules
|
11949
|
-
*/
|
11950
|
-
|
11951
|
-
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 };
|
12411
|
+
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 };
|
11952
12412
|
//# sourceMappingURL=ej2-filemanager.es5.js.map
|