@syncfusion/ej2-filemanager 25.2.6 → 26.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +3 -2
- package/dist/ej2-filemanager.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +914 -462
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +958 -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 +36 -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 +9 -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 +255 -396
- package/styles/file-manager/_material-dark-definition.scss +1 -0
- package/styles/file-manager/_material-definition.scss +1 -0
- package/styles/file-manager/_material3-definition.scss +1 -27
- package/styles/file-manager/_tailwind-definition.scss +1 -1
- package/styles/file-manager/_theme.scss +37 -85
- package/styles/file-manager/bootstrap-dark.css +116 -105
- package/styles/file-manager/bootstrap.css +117 -106
- package/styles/file-manager/bootstrap4.css +116 -105
- package/styles/file-manager/bootstrap5-dark.css +98 -98
- package/styles/file-manager/bootstrap5.css +98 -98
- package/styles/file-manager/fabric-dark.css +116 -105
- package/styles/file-manager/fabric.css +116 -105
- package/styles/file-manager/fluent-dark.css +107 -102
- package/styles/file-manager/fluent.css +107 -102
- package/styles/file-manager/fluent2.css +2872 -0
- package/styles/file-manager/fluent2.scss +16 -0
- package/styles/file-manager/highcontrast-light.css +116 -105
- package/styles/file-manager/highcontrast.css +116 -105
- package/styles/file-manager/icons/_bootstrap5.3.scss +235 -0
- package/styles/file-manager/icons/_fluent2.scss +235 -0
- package/styles/file-manager/material-dark.css +140 -108
- package/styles/file-manager/material.css +156 -112
- package/styles/file-manager/material3-dark.css +134 -109
- package/styles/file-manager/material3.css +134 -109
- package/styles/file-manager/tailwind-dark.css +93 -95
- package/styles/file-manager/tailwind.css +93 -95
- package/styles/fluent-dark.css +107 -102
- package/styles/fluent-dark.scss +16 -1
- package/styles/fluent.css +107 -102
- package/styles/fluent.scss +16 -1
- package/styles/fluent2.css +2872 -0
- package/styles/fluent2.scss +16 -0
- package/styles/highcontrast-light.css +116 -105
- package/styles/highcontrast-light.scss +16 -1
- package/styles/highcontrast.css +116 -105
- package/styles/highcontrast.scss +16 -1
- package/styles/material-dark.css +140 -108
- package/styles/material-dark.scss +16 -1
- package/styles/material.css +156 -112
- package/styles/material.scss +16 -1
- package/styles/material3-dark.css +134 -109
- package/styles/material3-dark.scss +16 -1
- package/styles/material3.css +134 -109
- package/styles/material3.scss +16 -1
- package/styles/tailwind-dark.css +93 -95
- package/styles/tailwind-dark.scss +16 -1
- package/styles/tailwind.css +93 -95
- package/styles/tailwind.scss +16 -1
- package/CHANGELOG.md +0 -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 */
|
@@ -6312,7 +6823,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6312
6823
|
this.disabledItems.push('Delete', 'Rename', 'Cut', 'Copy');
|
6313
6824
|
}
|
6314
6825
|
/* istanbul ignore next */
|
6315
|
-
// eslint:disable-next-line
|
6316
6826
|
}
|
6317
6827
|
else if (view === 'TreeView' || view === 'GridView' || view === 'LargeIcon') {
|
6318
6828
|
this.setLayoutItem(target);
|
@@ -6370,7 +6880,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6370
6880
|
}
|
6371
6881
|
});
|
6372
6882
|
};
|
6373
|
-
ContextMenu
|
6883
|
+
ContextMenu.prototype.updateActiveModule = function () {
|
6374
6884
|
this.parent.activeModule = closest(this.menuTarget, '#' + this.parent.element.id + TREE_ID) ?
|
6375
6885
|
'navigationpane' : closest(this.menuTarget, '#' + this.parent.element.id + GRID_ID) ?
|
6376
6886
|
'detailsview' : closest(this.menuTarget, '#' + this.parent.element.id + LARGEICON_ID) ?
|
@@ -6383,14 +6893,14 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6383
6893
|
* @returns {string} -returns the target view.
|
6384
6894
|
* @hidden
|
6385
6895
|
*/
|
6386
|
-
ContextMenu
|
6896
|
+
ContextMenu.prototype.getTargetView = function (target) {
|
6387
6897
|
return target.classList.contains(TREE_VIEW) ?
|
6388
6898
|
'TreeView' : target.classList.contains(GRID_VIEW) ?
|
6389
6899
|
'GridView' : target.classList.contains(ICON_VIEW) ?
|
6390
6900
|
'LargeIcon' : target.classList.contains(LARGE_ICONS) ?
|
6391
6901
|
'LargeIcon' : '';
|
6392
6902
|
};
|
6393
|
-
ContextMenu
|
6903
|
+
ContextMenu.prototype.getItemIndex = function (item) {
|
6394
6904
|
var itemId = this.getMenuId(item);
|
6395
6905
|
for (var i = 0; i < this.currentItems.length; i++) {
|
6396
6906
|
if ((this.currentItems[i].id === itemId) || (this.currentItems[i].id === item)) {
|
@@ -6399,12 +6909,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6399
6909
|
}
|
6400
6910
|
return -1;
|
6401
6911
|
};
|
6402
|
-
ContextMenu
|
6912
|
+
ContextMenu.prototype.disableItem = function (items) {
|
6403
6913
|
if (items.length !== 0) {
|
6404
6914
|
this.disabledItems = this.disabledItems.concat(items);
|
6405
6915
|
}
|
6406
6916
|
};
|
6407
|
-
ContextMenu
|
6917
|
+
ContextMenu.prototype.enableItems = function (items, enable, isUniqueId) {
|
6408
6918
|
for (var i = 0; i < items.length; i++) {
|
6409
6919
|
if (this.checkValidItem(items[i]) === 1) {
|
6410
6920
|
this.contextMenu.enableItems([this.getMenuId(items[i])], enable, isUniqueId);
|
@@ -6414,7 +6924,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6414
6924
|
}
|
6415
6925
|
}
|
6416
6926
|
};
|
6417
|
-
ContextMenu
|
6927
|
+
ContextMenu.prototype.setFolderItem = function (isTree) {
|
6418
6928
|
this.menuType = 'folder';
|
6419
6929
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.folder.map(function (item) { return item.trim(); }));
|
6420
6930
|
this.contextMenu.dataBind();
|
@@ -6423,6 +6933,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6423
6933
|
if (this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
|
6424
6934
|
this.disabledItems.push('Open');
|
6425
6935
|
}
|
6936
|
+
if (this.parent.selectedItems.length === 0) {
|
6937
|
+
var renameIndex = this.disabledItems.indexOf('Rename');
|
6938
|
+
if (renameIndex !== -1) {
|
6939
|
+
this.disabledItems.splice(renameIndex, 1);
|
6940
|
+
}
|
6941
|
+
}
|
6426
6942
|
}
|
6427
6943
|
else if (this.parent.activeModule !== 'navigationpane') {
|
6428
6944
|
if (this.parent.selectedItems.length === 1) {
|
@@ -6436,7 +6952,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6436
6952
|
}
|
6437
6953
|
}
|
6438
6954
|
};
|
6439
|
-
ContextMenu
|
6955
|
+
ContextMenu.prototype.setFileItem = function () {
|
6440
6956
|
this.menuType = 'file';
|
6441
6957
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.file.map(function (item) { return item.trim(); }));
|
6442
6958
|
this.contextMenu.dataBind();
|
@@ -6450,7 +6966,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6450
6966
|
this.disabledItems.push('Rename');
|
6451
6967
|
}
|
6452
6968
|
};
|
6453
|
-
ContextMenu
|
6969
|
+
ContextMenu.prototype.setLayoutItem = function (target) {
|
6454
6970
|
this.menuType = 'layout';
|
6455
6971
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.layout.map(function (item) { return item.trim(); }));
|
6456
6972
|
this.contextMenu.dataBind();
|
@@ -6470,7 +6986,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6470
6986
|
}
|
6471
6987
|
this.contextMenu.dataBind();
|
6472
6988
|
};
|
6473
|
-
ContextMenu
|
6989
|
+
ContextMenu.prototype.checkValidItem = function (nameEle) {
|
6474
6990
|
if (!isNullOrUndefined(select('#' + this.getMenuId(nameEle), this.currentElement))) {
|
6475
6991
|
return 1;
|
6476
6992
|
}
|
@@ -6481,26 +6997,23 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6481
6997
|
return -1;
|
6482
6998
|
}
|
6483
6999
|
};
|
6484
|
-
|
6485
|
-
ContextMenu$$1.prototype.getMenuItemData = function () {
|
7000
|
+
ContextMenu.prototype.getMenuItemData = function () {
|
6486
7001
|
if (this.menuType === 'layout') {
|
6487
7002
|
return getPathObject(this.parent);
|
6488
7003
|
}
|
6489
7004
|
else {
|
6490
|
-
// eslint-disable-next-line
|
6491
7005
|
var args = { target: this.menuTarget };
|
6492
7006
|
this.parent.notify(menuItemData, args);
|
6493
7007
|
return this.parent.itemData[0];
|
6494
7008
|
}
|
6495
7009
|
};
|
6496
7010
|
/* istanbul ignore next */
|
6497
|
-
ContextMenu
|
7011
|
+
ContextMenu.prototype.onSelect = function (args) {
|
6498
7012
|
var _this = this;
|
6499
7013
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
6500
7014
|
return;
|
6501
7015
|
}
|
6502
7016
|
var itemText = args.item.id.substr((this.parent.element.id + '_cm_').length);
|
6503
|
-
// eslint-disable-next-line
|
6504
7017
|
var details;
|
6505
7018
|
if (itemText === 'refresh' || itemText === 'newfolder' || itemText === 'upload') {
|
6506
7019
|
details = [getPathObject(this.parent)];
|
@@ -6525,7 +7038,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6525
7038
|
var sItems;
|
6526
7039
|
if (!menuClickArgs.cancel) {
|
6527
7040
|
_this.isMenuItemClicked = true;
|
6528
|
-
// eslint:disable-next-line
|
6529
7041
|
switch (itemText) {
|
6530
7042
|
case 'cut':
|
6531
7043
|
cutFiles(_this.parent);
|
@@ -6613,19 +7125,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6613
7125
|
case 'upload':
|
6614
7126
|
uploadItem(_this.parent);
|
6615
7127
|
break;
|
6616
|
-
/* istanbul ignore next */
|
6617
7128
|
case 'name':
|
6618
|
-
/* istanbul ignore next */
|
6619
|
-
// eslint-disable-next-line no-fallthrough
|
6620
7129
|
case 'size':
|
6621
|
-
/* istanbul ignore next */
|
6622
|
-
// eslint-disable-next-line no-fallthrough
|
6623
7130
|
case 'date':
|
6624
|
-
/* istanbul ignore next */
|
6625
|
-
// eslint-disable-next-line no-fallthrough
|
6626
7131
|
case 'ascending':
|
6627
|
-
/* istanbul ignore next */
|
6628
|
-
// eslint-disable-next-line no-fallthrough
|
6629
7132
|
case 'descending':
|
6630
7133
|
/* istanbul ignore next */
|
6631
7134
|
sortbyClickHandler(_this.parent, args);
|
@@ -6636,12 +7139,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6636
7139
|
sortbyClickHandler(_this.parent, args);
|
6637
7140
|
break;
|
6638
7141
|
/* istanbul ignore next */
|
6639
|
-
// eslint:disable-next-line
|
6640
7142
|
case 'largeiconsview':
|
6641
7143
|
updateLayout(_this.parent, 'LargeIcons');
|
6642
7144
|
break;
|
6643
7145
|
/* istanbul ignore next */
|
6644
|
-
// eslint:disable-next-line
|
6645
7146
|
case 'detailsview':
|
6646
7147
|
updateLayout(_this.parent, 'Details');
|
6647
7148
|
break;
|
@@ -6649,7 +7150,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6649
7150
|
}
|
6650
7151
|
});
|
6651
7152
|
};
|
6652
|
-
ContextMenu
|
7153
|
+
ContextMenu.prototype.onPropertyChanged = function (e) {
|
6653
7154
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
6654
7155
|
/* istanbul ignore next */
|
6655
7156
|
return;
|
@@ -6663,7 +7164,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6663
7164
|
}
|
6664
7165
|
}
|
6665
7166
|
};
|
6666
|
-
ContextMenu
|
7167
|
+
ContextMenu.prototype.addEventListener = function () {
|
6667
7168
|
this.parent.on(destroy, this.destroy, this);
|
6668
7169
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
6669
7170
|
this.keyboardModule = new KeyboardEvents(this.contextMenu.element, {
|
@@ -6672,12 +7173,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6672
7173
|
eventName: 'keydown'
|
6673
7174
|
});
|
6674
7175
|
};
|
6675
|
-
ContextMenu
|
7176
|
+
ContextMenu.prototype.removeEventListener = function () {
|
6676
7177
|
this.parent.off(destroy, this.destroy);
|
6677
7178
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
6678
7179
|
this.keyboardModule.destroy();
|
6679
7180
|
};
|
6680
|
-
ContextMenu
|
7181
|
+
ContextMenu.prototype.keyActionHandler = function (e) {
|
6681
7182
|
switch (e.action) {
|
6682
7183
|
case 'uparrow':
|
6683
7184
|
case 'downarrow':
|
@@ -6690,10 +7191,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6690
7191
|
* @returns {string} - returns the module name.
|
6691
7192
|
* @private
|
6692
7193
|
*/
|
6693
|
-
ContextMenu
|
7194
|
+
ContextMenu.prototype.getModuleName = function () {
|
6694
7195
|
return 'contextmenu';
|
6695
7196
|
};
|
6696
|
-
ContextMenu
|
7197
|
+
ContextMenu.prototype.destroy = function () {
|
6697
7198
|
if (this.parent.isDestroyed) {
|
6698
7199
|
return;
|
6699
7200
|
}
|
@@ -6702,7 +7203,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6702
7203
|
this.targetElement = null;
|
6703
7204
|
};
|
6704
7205
|
/* istanbul ignore next */
|
6705
|
-
ContextMenu
|
7206
|
+
ContextMenu.prototype.getItemData = function (data) {
|
6706
7207
|
var items = [];
|
6707
7208
|
for (var i = 0; i < data.length; i++) {
|
6708
7209
|
var item = void 0;
|
@@ -6806,16 +7307,15 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6806
7307
|
}
|
6807
7308
|
return items;
|
6808
7309
|
};
|
6809
|
-
ContextMenu
|
7310
|
+
ContextMenu.prototype.getMenuId = function (id) {
|
6810
7311
|
return this.parent.element.id + '_cm_' + id.split(' ').join('').toLowerCase();
|
6811
7312
|
};
|
6812
|
-
return ContextMenu
|
7313
|
+
return ContextMenu;
|
6813
7314
|
}());
|
6814
7315
|
|
6815
7316
|
/**
|
6816
7317
|
* Specifies the default locale of FileManager component
|
6817
7318
|
*/
|
6818
|
-
// eslint-disable-next-line
|
6819
7319
|
var defaultLocale = {
|
6820
7320
|
'NewFolder': 'New folder',
|
6821
7321
|
'Upload': 'Upload',
|
@@ -6949,14 +7449,13 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6949
7449
|
__extends$8(FileManager, _super);
|
6950
7450
|
function FileManager(options, element) {
|
6951
7451
|
var _this = _super.call(this, options, element) || this;
|
6952
|
-
// eslint-disable-next-line
|
6953
7452
|
_this.filterData = null;
|
6954
7453
|
_this.selectedNodes = [];
|
6955
7454
|
_this.duplicateItems = [];
|
6956
|
-
// eslint-disable-next-line
|
6957
7455
|
_this.duplicateRecords = [];
|
6958
7456
|
_this.previousPath = [];
|
6959
7457
|
_this.nextPath = [];
|
7458
|
+
_this.existingFileCount = 0;
|
6960
7459
|
_this.isLayoutChange = false;
|
6961
7460
|
_this.layoutSelectedItems = [];
|
6962
7461
|
_this.renamedId = null;
|
@@ -6978,11 +7477,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6978
7477
|
_this.isOpened = false;
|
6979
7478
|
_this.isRetryOpened = false;
|
6980
7479
|
_this.isPathDrag = false;
|
6981
|
-
// eslint-disable-next-line
|
6982
7480
|
_this.searchedItems = [];
|
6983
7481
|
_this.retryFiles = [];
|
6984
7482
|
_this.isApplySame = false;
|
6985
|
-
// eslint-disable-next-line
|
6986
7483
|
_this.dragData = [];
|
6987
7484
|
_this.dragNodes = [];
|
6988
7485
|
_this.dragPath = '';
|
@@ -6992,13 +7489,12 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6992
7489
|
_this.dragCursorPosition = { left: 44, top: 18 };
|
6993
7490
|
_this.isDropEnd = false;
|
6994
7491
|
_this.dragCount = 0;
|
6995
|
-
// eslint-disable-next-line
|
6996
7492
|
_this.droppedObjects = [];
|
6997
7493
|
_this.uploadingCount = 0;
|
6998
7494
|
_this.uploadedCount = 0;
|
6999
|
-
//Specifies whether the operating system is MAC or not
|
7495
|
+
//Specifies whether the operating system is MAC or not
|
7000
7496
|
_this.isMac = false;
|
7001
|
-
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu
|
7497
|
+
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
|
7002
7498
|
return _this;
|
7003
7499
|
}
|
7004
7500
|
FileManager_1 = FileManager;
|
@@ -7390,7 +7886,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7390
7886
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
7391
7887
|
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
7392
7888
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
7393
|
-
// eslint-disable-next-line
|
7394
7889
|
var ajaxSettings = {
|
7395
7890
|
url: uploadUrl,
|
7396
7891
|
type: 'POST',
|
@@ -7406,7 +7901,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7406
7901
|
this.trigger('beforeSend', this.uploadEventArgs, function (uploadEventArgs) {
|
7407
7902
|
args.customFormData = JSON.parse(getValue('data', uploadEventArgs.ajaxSettings));
|
7408
7903
|
args.cancel = uploadEventArgs.cancel;
|
7409
|
-
// eslint-disable-next-line
|
7410
7904
|
var eventArgs = {
|
7411
7905
|
cancel: false,
|
7412
7906
|
httpRequest: args.currentRequest
|
@@ -7443,7 +7937,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7443
7937
|
}
|
7444
7938
|
this.uploadingCount = args.filesData.length;
|
7445
7939
|
this.uploadedCount = 0;
|
7446
|
-
// eslint-disable-next-line
|
7447
7940
|
var details = getPathObject(this);
|
7448
7941
|
if (!hasUploadAccess(details)) {
|
7449
7942
|
args.cancel = true;
|
@@ -7452,7 +7945,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7452
7945
|
}
|
7453
7946
|
this.uploadDialogObj.show();
|
7454
7947
|
};
|
7455
|
-
// eslint-disable-next-line
|
7456
7948
|
FileManager.prototype.onFileUploadSuccess = function (args) {
|
7457
7949
|
this.uploadedCount = this.uploadedCount + args.count;
|
7458
7950
|
if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
|
@@ -7460,7 +7952,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7460
7952
|
}
|
7461
7953
|
};
|
7462
7954
|
/* istanbul ignore next */
|
7463
|
-
// eslint-disable-next-line
|
7464
7955
|
FileManager.prototype.onUploadSuccess = function (files) {
|
7465
7956
|
var args = { action: 'Upload', result: files };
|
7466
7957
|
this.trigger('success', args);
|
@@ -7472,9 +7963,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7472
7963
|
}
|
7473
7964
|
};
|
7474
7965
|
/* istanbul ignore next */
|
7475
|
-
// eslint-disable-next-line
|
7476
7966
|
FileManager.prototype.onUploadFailure = function (files) {
|
7477
|
-
// eslint-disable-next-line
|
7478
7967
|
var response = getValue('response', files);
|
7479
7968
|
var statusText = getValue('statusText', response);
|
7480
7969
|
if (statusText !== '') {
|
@@ -7558,7 +8047,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7558
8047
|
break;
|
7559
8048
|
case 'ctrlU':
|
7560
8049
|
e.preventDefault();
|
7561
|
-
if (this.toolbarSettings.items.indexOf('Upload')
|
8050
|
+
if (this.toolbarSettings.items.indexOf('Upload') !== -1) {
|
7562
8051
|
uploadEle = select('#' + this.element.id + UPLOAD_ID, this.element);
|
7563
8052
|
uploadEle.click();
|
7564
8053
|
}
|
@@ -7592,7 +8081,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7592
8081
|
* @private
|
7593
8082
|
*/
|
7594
8083
|
/* istanbul ignore next */
|
7595
|
-
// eslint:disable-next-line
|
7596
8084
|
FileManager.prototype.onPropertyChanged = function (newProp, oldProp) {
|
7597
8085
|
var height;
|
7598
8086
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
@@ -7725,6 +8213,10 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7725
8213
|
this.viewerObj.target = newProp.popupTarget;
|
7726
8214
|
}
|
7727
8215
|
break;
|
8216
|
+
case 'fileSystemData':
|
8217
|
+
this.fileSystemData = newProp.fileSystemData;
|
8218
|
+
this.refresh();
|
8219
|
+
break;
|
7728
8220
|
}
|
7729
8221
|
}
|
7730
8222
|
};
|
@@ -7810,7 +8302,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7810
8302
|
*/
|
7811
8303
|
FileManager.prototype.createFolder = function (name) {
|
7812
8304
|
this.notify(methodCall, { action: 'createFolder' });
|
7813
|
-
// eslint-disable-next-line
|
7814
8305
|
var details = [getPathObject(this)];
|
7815
8306
|
this.itemData = details;
|
7816
8307
|
if (name) {
|
@@ -7933,7 +8424,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7933
8424
|
*
|
7934
8425
|
* @returns {void}
|
7935
8426
|
*/
|
7936
|
-
// eslint-disable-next-line
|
7937
8427
|
FileManager.prototype.filterFiles = function (filterData) {
|
7938
8428
|
this.filterData = filterData ? filterData : null;
|
7939
8429
|
this.setProperties({ selectedItems: [] }, true);
|
@@ -7949,7 +8439,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7949
8439
|
*
|
7950
8440
|
* @returns {Object[]} - returns selected files.
|
7951
8441
|
*/
|
7952
|
-
// eslint-disable-next-line
|
7953
8442
|
FileManager.prototype.getSelectedFiles = function () {
|
7954
8443
|
this.notify(updateSelectionData, {});
|
7955
8444
|
return this.itemData;
|
@@ -8021,11 +8510,18 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8021
8510
|
* @returns {void}
|
8022
8511
|
*/
|
8023
8512
|
FileManager.prototype.uploadFiles = function () {
|
8024
|
-
// eslint-disable-next-line
|
8025
8513
|
var details = [getPathObject(this)];
|
8026
8514
|
this.itemData = details;
|
8027
8515
|
uploadItem(this);
|
8028
8516
|
};
|
8517
|
+
/**
|
8518
|
+
* Specifies the method which must be invoked to programmatically close the dialog popup in the file manager.
|
8519
|
+
*
|
8520
|
+
* @returns {void}
|
8521
|
+
*/
|
8522
|
+
FileManager.prototype.closeDialog = function () {
|
8523
|
+
closePopup(this);
|
8524
|
+
};
|
8029
8525
|
/**
|
8030
8526
|
* Specifies the direction of FileManager
|
8031
8527
|
*
|
@@ -8048,6 +8544,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8048
8544
|
__decorate$8([
|
8049
8545
|
Complex({}, AjaxSettings)
|
8050
8546
|
], FileManager.prototype, "ajaxSettings", void 0);
|
8547
|
+
__decorate$8([
|
8548
|
+
Property([])
|
8549
|
+
], FileManager.prototype, "fileSystemData", void 0);
|
8051
8550
|
__decorate$8([
|
8052
8551
|
Property(false)
|
8053
8552
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
@@ -8153,9 +8652,36 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8153
8652
|
__decorate$8([
|
8154
8653
|
Event()
|
8155
8654
|
], FileManager.prototype, "created", void 0);
|
8655
|
+
__decorate$8([
|
8656
|
+
Event()
|
8657
|
+
], FileManager.prototype, "beforeFolderCreate", void 0);
|
8658
|
+
__decorate$8([
|
8659
|
+
Event()
|
8660
|
+
], FileManager.prototype, "folderCreate", void 0);
|
8156
8661
|
__decorate$8([
|
8157
8662
|
Event()
|
8158
8663
|
], FileManager.prototype, "destroyed", void 0);
|
8664
|
+
__decorate$8([
|
8665
|
+
Event()
|
8666
|
+
], FileManager.prototype, "beforeDelete", void 0);
|
8667
|
+
__decorate$8([
|
8668
|
+
Event()
|
8669
|
+
], FileManager.prototype, "delete", void 0);
|
8670
|
+
__decorate$8([
|
8671
|
+
Event()
|
8672
|
+
], FileManager.prototype, "beforeRename", void 0);
|
8673
|
+
__decorate$8([
|
8674
|
+
Event()
|
8675
|
+
], FileManager.prototype, "rename", void 0);
|
8676
|
+
__decorate$8([
|
8677
|
+
Event()
|
8678
|
+
], FileManager.prototype, "beforeMove", void 0);
|
8679
|
+
__decorate$8([
|
8680
|
+
Event()
|
8681
|
+
], FileManager.prototype, "move", void 0);
|
8682
|
+
__decorate$8([
|
8683
|
+
Event()
|
8684
|
+
], FileManager.prototype, "search", void 0);
|
8159
8685
|
__decorate$8([
|
8160
8686
|
Event()
|
8161
8687
|
], FileManager.prototype, "fileDragStart", void 0);
|
@@ -8207,26 +8733,11 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8207
8733
|
return FileManager;
|
8208
8734
|
}(Component));
|
8209
8735
|
|
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
8736
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
8226
8737
|
/**
|
8227
8738
|
* Toolbar module
|
8228
8739
|
*/
|
8229
|
-
var Toolbar
|
8740
|
+
var Toolbar = /** @__PURE__ @class */ (function () {
|
8230
8741
|
/**
|
8231
8742
|
* Constructor for the Toolbar module
|
8232
8743
|
*
|
@@ -8234,7 +8745,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8234
8745
|
* @param {IFileManager} parent - specifies the parent element.
|
8235
8746
|
* @private
|
8236
8747
|
*/
|
8237
|
-
function Toolbar
|
8748
|
+
function Toolbar(parent) {
|
8238
8749
|
this.default = ['Delete', 'Rename', 'Download', 'Cut', 'Copy', 'Paste'];
|
8239
8750
|
this.single = ['Delete', 'Rename', 'Download', 'Cut', 'Copy'];
|
8240
8751
|
this.multiple = ['Delete', 'Download', 'Cut', 'Copy', 'Refresh'];
|
@@ -8243,13 +8754,13 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8243
8754
|
this.render();
|
8244
8755
|
this.addEventListener();
|
8245
8756
|
}
|
8246
|
-
Toolbar
|
8757
|
+
Toolbar.prototype.render = function () {
|
8247
8758
|
var _this = this;
|
8248
8759
|
this.items = this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function (item) { return item.trim(); })));
|
8249
8760
|
var eventArgs = { items: this.items };
|
8250
8761
|
this.parent.trigger('toolbarCreate', eventArgs, function (toolbarCreateArgs) {
|
8251
8762
|
_this.items = toolbarCreateArgs.items;
|
8252
|
-
_this.toolbarObj = new Toolbar({
|
8763
|
+
_this.toolbarObj = new Toolbar$1({
|
8253
8764
|
items: _this.items,
|
8254
8765
|
created: _this.toolbarCreateHandler.bind(_this),
|
8255
8766
|
overflowMode: 'Popup',
|
@@ -8262,7 +8773,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8262
8773
|
_this.toolbarObj.appendTo('#' + _this.parent.element.id + TOOLBAR_ID);
|
8263
8774
|
});
|
8264
8775
|
};
|
8265
|
-
Toolbar
|
8776
|
+
Toolbar.prototype.getItemIndex = function (item) {
|
8266
8777
|
var itemId = this.getId(item);
|
8267
8778
|
for (var i = 0; i < this.items.length; i++) {
|
8268
8779
|
if (this.items[i].id === itemId) {
|
@@ -8271,7 +8782,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8271
8782
|
}
|
8272
8783
|
return -1;
|
8273
8784
|
};
|
8274
|
-
Toolbar
|
8785
|
+
Toolbar.prototype.getItems = function (items) {
|
8275
8786
|
var currItems = items.slice();
|
8276
8787
|
if (this.parent.isDevice && this.parent.allowMultiSelection) {
|
8277
8788
|
currItems.push('SelectAll');
|
@@ -8282,13 +8793,12 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8282
8793
|
return currItems;
|
8283
8794
|
};
|
8284
8795
|
/* istanbul ignore next */
|
8285
|
-
Toolbar
|
8796
|
+
Toolbar.prototype.onClicked = function (args) {
|
8286
8797
|
var _this = this;
|
8287
8798
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
8288
8799
|
return;
|
8289
8800
|
}
|
8290
8801
|
var tool = args.item.id.substr((this.parent.element.id + '_tb_').length);
|
8291
|
-
// eslint-disable-next-line
|
8292
8802
|
var details;
|
8293
8803
|
if (tool === 'refresh' || tool === 'newfolder' || tool === 'upload') {
|
8294
8804
|
details = [getPathObject(this.parent)];
|
@@ -8368,7 +8878,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8368
8878
|
}
|
8369
8879
|
});
|
8370
8880
|
};
|
8371
|
-
Toolbar
|
8881
|
+
Toolbar.prototype.toolbarCreateHandler = function () {
|
8372
8882
|
var _this = this;
|
8373
8883
|
if (!isNullOrUndefined(select('#' + this.getId('SortBy'), this.parent.element))) {
|
8374
8884
|
var items = [
|
@@ -8453,7 +8963,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8453
8963
|
}
|
8454
8964
|
this.parent.refreshLayout();
|
8455
8965
|
};
|
8456
|
-
Toolbar
|
8966
|
+
Toolbar.prototype.updateSortByButton = function () {
|
8457
8967
|
if (this.buttonObj) {
|
8458
8968
|
var items = this.buttonObj.items;
|
8459
8969
|
for (var itemCount = 0; itemCount < items.length; itemCount++) {
|
@@ -8483,10 +8993,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8483
8993
|
}
|
8484
8994
|
}
|
8485
8995
|
};
|
8486
|
-
Toolbar
|
8996
|
+
Toolbar.prototype.getPupupId = function (id) {
|
8487
8997
|
return this.parent.element.id + '_ddl_' + id.toLowerCase();
|
8488
8998
|
};
|
8489
|
-
Toolbar
|
8999
|
+
Toolbar.prototype.layoutChange = function (args) {
|
8490
9000
|
if (this.parent.view === 'Details') {
|
8491
9001
|
if (args.item.id === this.getPupupId('large')) {
|
8492
9002
|
updateLayout(this.parent, 'LargeIcons');
|
@@ -8498,7 +9008,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8498
9008
|
}
|
8499
9009
|
}
|
8500
9010
|
};
|
8501
|
-
Toolbar
|
9011
|
+
Toolbar.prototype.toolbarItemData = function (data) {
|
8502
9012
|
var items = [];
|
8503
9013
|
var mode = 'Both';
|
8504
9014
|
if (this.parent.isMobile) {
|
@@ -8591,7 +9101,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8591
9101
|
break;
|
8592
9102
|
}
|
8593
9103
|
if (this.parent.toolbarItems.length > 0 && propItem) {
|
8594
|
-
var mergedItems =
|
9104
|
+
var mergedItems = Object.assign({}, item, propItem);
|
8595
9105
|
items.push(mergedItems);
|
8596
9106
|
}
|
8597
9107
|
else {
|
@@ -8600,7 +9110,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8600
9110
|
}
|
8601
9111
|
return items;
|
8602
9112
|
};
|
8603
|
-
Toolbar
|
9113
|
+
Toolbar.prototype.getItemModel = function (propItem) {
|
8604
9114
|
var item = {};
|
8605
9115
|
if (propItem.id) {
|
8606
9116
|
item.id = propItem.id;
|
@@ -8655,10 +9165,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8655
9165
|
}
|
8656
9166
|
return item;
|
8657
9167
|
};
|
8658
|
-
Toolbar
|
9168
|
+
Toolbar.prototype.getId = function (id) {
|
8659
9169
|
return this.parent.element.id + '_tb_' + id.toLowerCase();
|
8660
9170
|
};
|
8661
|
-
Toolbar
|
9171
|
+
Toolbar.prototype.addEventListener = function () {
|
8662
9172
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
8663
9173
|
this.parent.on(selectionChanged, this.onSelectionChanged, this);
|
8664
9174
|
this.parent.on(layoutChange, this.onLayoutChange, this);
|
@@ -8667,7 +9177,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8667
9177
|
this.parent.on(destroy, this.destroy, this);
|
8668
9178
|
this.parent.on(sortByChange, this.updateSortByButton, this);
|
8669
9179
|
};
|
8670
|
-
Toolbar
|
9180
|
+
Toolbar.prototype.reRenderToolbar = function (e) {
|
8671
9181
|
var _this = this;
|
8672
9182
|
var itemsToProcess = [];
|
8673
9183
|
if (this.parent.toolbarItems.length > 0) {
|
@@ -8697,7 +9207,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8697
9207
|
});
|
8698
9208
|
}
|
8699
9209
|
};
|
8700
|
-
Toolbar
|
9210
|
+
Toolbar.prototype.onSelectionChanged = function () {
|
8701
9211
|
this.hideStatus();
|
8702
9212
|
this.hideItems(this.single, true);
|
8703
9213
|
this.hideItems(this.selection, false);
|
@@ -8722,7 +9232,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8722
9232
|
this.toolbarObj.hideItem(ele.parentElement, false);
|
8723
9233
|
}
|
8724
9234
|
};
|
8725
|
-
Toolbar
|
9235
|
+
Toolbar.prototype.hideItems = function (tools, toHide) {
|
8726
9236
|
for (var i = 0; i < tools.length; i++) {
|
8727
9237
|
var ele = select('#' + this.getId(tools[i]), this.parent.element);
|
8728
9238
|
if (ele) {
|
@@ -8730,19 +9240,19 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8730
9240
|
}
|
8731
9241
|
}
|
8732
9242
|
};
|
8733
|
-
Toolbar
|
9243
|
+
Toolbar.prototype.hideStatus = function () {
|
8734
9244
|
var ele = select('#' + this.getId('Selection'), this.toolbarObj.element);
|
8735
9245
|
if (ele) {
|
8736
9246
|
this.toolbarObj.hideItem(ele.parentElement, true);
|
8737
9247
|
}
|
8738
9248
|
};
|
8739
|
-
Toolbar
|
9249
|
+
Toolbar.prototype.showPaste = function () {
|
8740
9250
|
this.hideItems(['Paste'], false);
|
8741
9251
|
};
|
8742
|
-
Toolbar
|
9252
|
+
Toolbar.prototype.hidePaste = function () {
|
8743
9253
|
this.hideItems(['Paste'], true);
|
8744
9254
|
};
|
8745
|
-
Toolbar
|
9255
|
+
Toolbar.prototype.onLayoutChange = function () {
|
8746
9256
|
if (this.layoutBtnObj) {
|
8747
9257
|
this.layoutBtnObj.iconCss = this.parent.view === 'Details' ? ICON_GRID : ICON_LARGE;
|
8748
9258
|
var items = this.layoutBtnObj.items;
|
@@ -8756,7 +9266,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8756
9266
|
}
|
8757
9267
|
}
|
8758
9268
|
};
|
8759
|
-
Toolbar
|
9269
|
+
Toolbar.prototype.removeEventListener = function () {
|
8760
9270
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
8761
9271
|
this.parent.off(selectionChanged, this.onSelectionChanged);
|
8762
9272
|
this.parent.off(layoutChange, this.onLayoutChange);
|
@@ -8771,10 +9281,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8771
9281
|
* @returns {string} - returns module name.
|
8772
9282
|
* @private
|
8773
9283
|
*/
|
8774
|
-
Toolbar
|
9284
|
+
Toolbar.prototype.getModuleName = function () {
|
8775
9285
|
return 'toolbar';
|
8776
9286
|
};
|
8777
|
-
Toolbar
|
9287
|
+
Toolbar.prototype.onPropertyChanged = function (e) {
|
8778
9288
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
8779
9289
|
/* istanbul ignore next */
|
8780
9290
|
return;
|
@@ -8801,7 +9311,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8801
9311
|
}
|
8802
9312
|
}
|
8803
9313
|
};
|
8804
|
-
Toolbar
|
9314
|
+
Toolbar.prototype.destroy = function () {
|
8805
9315
|
if (this.parent.isDestroyed) {
|
8806
9316
|
return;
|
8807
9317
|
}
|
@@ -8815,7 +9325,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8815
9325
|
this.toolbarObj.destroy();
|
8816
9326
|
this.parent.refreshLayout();
|
8817
9327
|
};
|
8818
|
-
Toolbar
|
9328
|
+
Toolbar.prototype.enableItems = function (items, isEnable) {
|
8819
9329
|
for (var i = 0; i < items.length; i++) {
|
8820
9330
|
var ele = select('#' + this.getId(items[i]), this.parent.element);
|
8821
9331
|
if (ele) {
|
@@ -8823,7 +9333,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8823
9333
|
}
|
8824
9334
|
}
|
8825
9335
|
};
|
8826
|
-
return Toolbar
|
9336
|
+
return Toolbar;
|
8827
9337
|
}());
|
8828
9338
|
|
8829
9339
|
var Virtualization = /** @__PURE__ @class */ (function () {
|
@@ -8833,6 +9343,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8833
9343
|
}
|
8834
9344
|
/**
|
8835
9345
|
* Sets up UI virtualization for the large icon view.
|
9346
|
+
*
|
9347
|
+
* @returns {void}
|
8836
9348
|
*/
|
8837
9349
|
Virtualization.prototype.setUIVirtualization = function () {
|
8838
9350
|
// Get the current view data source
|
@@ -8858,6 +9370,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8858
9370
|
/**
|
8859
9371
|
* Sets the height of the top and bottom elements that are used for virtualization.
|
8860
9372
|
* These elements are used to give the appearance of an infinitely scrolling list.
|
9373
|
+
*
|
9374
|
+
* @returns {void}
|
8861
9375
|
*/
|
8862
9376
|
Virtualization.prototype.setUlElementHeight = function () {
|
8863
9377
|
// Calculate the number of items in the last row
|
@@ -8865,10 +9379,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8865
9379
|
(this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
|
8866
9380
|
// Create top and bottom elements
|
8867
9381
|
this.topElement = this.filemanagerInstance.createElement('div');
|
8868
|
-
this.topElement.classList.add(
|
9382
|
+
this.topElement.classList.add('e-virtual-top');
|
8869
9383
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
|
8870
9384
|
this.bottomElement = this.filemanagerInstance.createElement('div');
|
8871
|
-
this.bottomElement.classList.add(
|
9385
|
+
this.bottomElement.classList.add('e-virtual-bottom');
|
8872
9386
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
|
8873
9387
|
// Get the margin value for list items
|
8874
9388
|
var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
|
@@ -8890,17 +9404,21 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8890
9404
|
};
|
8891
9405
|
/**
|
8892
9406
|
* Calculates the number of items to display in the list based on the available width and height.
|
8893
|
-
*
|
8894
|
-
* @
|
9407
|
+
*
|
9408
|
+
* @param {number} dataSourceLength The length of the data source.
|
9409
|
+
* @returns {number} The number of items to display.
|
8895
9410
|
*/
|
8896
9411
|
Virtualization.prototype.getItemCount = function (dataSourceLength) {
|
8897
9412
|
// Get the margin values for list items
|
8898
9413
|
var widthMargin = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
|
8899
9414
|
parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
|
8900
9415
|
// Calculate the number of items that can fit in a single row
|
8901
|
-
this.rowItemCount =
|
9416
|
+
this.rowItemCount =
|
9417
|
+
Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) /
|
9418
|
+
(this.itemList[0].offsetWidth + widthMargin));
|
8902
9419
|
// Calculate the number of items that can fit in the available height
|
8903
|
-
var itemCount = this.rowItemCount *
|
9420
|
+
var itemCount = this.rowItemCount *
|
9421
|
+
(Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
|
8904
9422
|
// If the calculated item count is greater than the data source length, set the item count to the data source length
|
8905
9423
|
if (itemCount > dataSourceLength) {
|
8906
9424
|
itemCount = dataSourceLength;
|
@@ -8909,7 +9427,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8909
9427
|
};
|
8910
9428
|
/**
|
8911
9429
|
* Wires or un wires the scroll event for the list element.
|
8912
|
-
*
|
9430
|
+
*
|
9431
|
+
* @param {boolean} destroy - Set `true` to unwire the scroll event.
|
9432
|
+
* @returns {void}
|
8913
9433
|
*/
|
8914
9434
|
Virtualization.prototype.wireScrollEvent = function (destroy) {
|
8915
9435
|
if (!destroy) {
|
@@ -8924,6 +9444,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8924
9444
|
/**
|
8925
9445
|
* Handles the scroll event for the list element.
|
8926
9446
|
* This method updates the top and bottom elements and the displayed items based on the scroll position.
|
9447
|
+
*
|
9448
|
+
* @returns {void}
|
9449
|
+
* @private
|
8927
9450
|
*/
|
8928
9451
|
Virtualization.prototype.onVirtualUiScroll = function () {
|
8929
9452
|
var _a;
|
@@ -8961,14 +9484,16 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8961
9484
|
this.scrollPosition = scroll;
|
8962
9485
|
// Update the list of items and the items property of the largeIconInstance
|
8963
9486
|
this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
|
8964
|
-
this.itemCount = this.itemCount
|
9487
|
+
this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ? this.largeIconInstance.itemList.length : this.itemCount;
|
8965
9488
|
this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
|
8966
9489
|
this.itemCount, this.renderedCount);
|
8967
9490
|
};
|
8968
9491
|
/**
|
8969
9492
|
* Calculates the current scroll position of the list element.
|
8970
|
-
*
|
8971
|
-
* @
|
9493
|
+
*
|
9494
|
+
* @param {number} startingHeight The starting height from which to calculate the scroll position.
|
9495
|
+
* @returns {number} The current scroll position.
|
9496
|
+
* @private
|
8972
9497
|
*/
|
8973
9498
|
Virtualization.prototype.getscrollerHeight = function (startingHeight) {
|
8974
9499
|
// If the scroll position is less than or equal to the starting height, return 0.
|
@@ -8978,8 +9503,11 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8978
9503
|
};
|
8979
9504
|
/**
|
8980
9505
|
* This method updates the displayed items and the selection based on the scroll direction.
|
8981
|
-
*
|
8982
|
-
* @param
|
9506
|
+
*
|
9507
|
+
* @param {number} listDiff The number of rows to update.
|
9508
|
+
* @param {boolean} isScrollingDown If set to true, the scroll direction is downward.
|
9509
|
+
* @returns {void}
|
9510
|
+
* @private
|
8983
9511
|
*/
|
8984
9512
|
Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
|
8985
9513
|
// Update the displayed items
|
@@ -8989,7 +9517,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8989
9517
|
};
|
8990
9518
|
/**
|
8991
9519
|
* Updates the items in the large icons view.
|
8992
|
-
*
|
9520
|
+
*
|
9521
|
+
* @param {boolean} isScrollingDown - If set to true, the scroll direction is downward.
|
9522
|
+
* @returns {void}
|
9523
|
+
* @private
|
8993
9524
|
*/
|
8994
9525
|
Virtualization.prototype.updateUI = function (isScrollingDown) {
|
8995
9526
|
var _this = this;
|
@@ -9063,6 +9594,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9063
9594
|
};
|
9064
9595
|
/**
|
9065
9596
|
* Destroys the component.
|
9597
|
+
*
|
9598
|
+
* @returns {void}
|
9066
9599
|
*/
|
9067
9600
|
Virtualization.prototype.destroy = function () {
|
9068
9601
|
// If the file manager has already been destroyed, return immediately
|
@@ -9077,10 +9610,6 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9077
9610
|
return Virtualization;
|
9078
9611
|
}());
|
9079
9612
|
|
9080
|
-
/**
|
9081
|
-
* File Manager actions modules
|
9082
|
-
*/
|
9083
|
-
|
9084
9613
|
/**
|
9085
9614
|
* NavigationPane module
|
9086
9615
|
*/
|
@@ -9127,10 +9656,8 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9127
9656
|
if (!isNullOrUndefined(this.treeObj)) {
|
9128
9657
|
return;
|
9129
9658
|
}
|
9130
|
-
// eslint-disable-next-line
|
9131
9659
|
var rootData = getValue(this.parent.pathId[0], this.parent.feParent);
|
9132
9660
|
setValue('_fm_icon', 'e-fe-folder', rootData);
|
9133
|
-
// eslint-disable-next-line
|
9134
9661
|
var attr = {};
|
9135
9662
|
var id = getValue('id', rootData);
|
9136
9663
|
if (!isNullOrUndefined(id)) {
|
@@ -9202,7 +9729,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9202
9729
|
this.parent.activeElements = [dragLi];
|
9203
9730
|
this.parent.dragNodes = [];
|
9204
9731
|
getModule(this.parent, dragLi);
|
9205
|
-
// eslint-disable-next-line
|
9206
9732
|
this.parent.dragData = this.getTreeData(dragLi);
|
9207
9733
|
this.parent.dragPath = this.getDragPath(dragLi, this.parent.dragData[0].name);
|
9208
9734
|
this.parent.dragNodes.push(this.parent.dragData[0].name);
|
@@ -9226,19 +9752,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9226
9752
|
};
|
9227
9753
|
this.parent.trigger('fileLoad', eventArgs);
|
9228
9754
|
};
|
9229
|
-
// eslint-disable-next-line
|
9230
9755
|
NavigationPane.prototype.addChild = function (files, target, prevent) {
|
9231
|
-
// eslint-disable-next-line
|
9232
9756
|
var directories = getDirectories(files);
|
9233
|
-
|
9234
|
-
|
9757
|
+
var targetDirectory = this.getTreeData(target);
|
9758
|
+
if (directories.length > 0 && targetDirectory.length > 0 &&
|
9759
|
+
(directories[0].filterPath == null ||
|
9760
|
+
isNullOrUndefined(targetDirectory[0])
|
9761
|
+
&& targetDirectory[0].filterPath == null
|
9762
|
+
|| directories[0].filterPath !==
|
9763
|
+
targetDirectory[0].filterPath)) {
|
9235
9764
|
var length_1 = 0;
|
9236
|
-
// eslint-disable-next-line
|
9237
9765
|
var folders = directories;
|
9238
9766
|
while (length_1 < directories.length) {
|
9239
|
-
// eslint-disable-next-line
|
9240
|
-
folders[length_1]._fm_icon = 'e-fe-folder';
|
9241
|
-
// eslint-disable-next-line
|
9767
|
+
// eslint-disable-next-line camelcase
|
9768
|
+
folders[parseInt(length_1.toString(), 10)]._fm_icon = 'e-fe-folder';
|
9242
9769
|
var attr = {};
|
9243
9770
|
var id = getValue('id', folders[length_1]);
|
9244
9771
|
if (!isNullOrUndefined(id)) {
|
@@ -9255,21 +9782,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9255
9782
|
var element = select('[data-uid="' + target + '"]', this.treeObj.element);
|
9256
9783
|
var childElements = select('ul', element);
|
9257
9784
|
if (isNullOrUndefined(childElements)) {
|
9258
|
-
// eslint-disable-next-line
|
9259
9785
|
this.treeObj.addNodes(directories, target, null, prevent);
|
9260
9786
|
}
|
9261
9787
|
}
|
9262
9788
|
};
|
9263
9789
|
// Node Selecting event handler
|
9264
9790
|
NavigationPane.prototype.onNodeSelecting = function (args) {
|
9265
|
-
if (!args.isInteracted && !this.isRightClick &&
|
9791
|
+
if (!args.isInteracted && !this.isRightClick &&
|
9792
|
+
!this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
|
9266
9793
|
this.restrictSelecting = false;
|
9267
9794
|
this.isNodeClickCalled = false;
|
9268
9795
|
return;
|
9269
9796
|
}
|
9270
9797
|
if (!this.renameParent) {
|
9271
9798
|
this.parent.activeModule = 'navigationpane';
|
9272
|
-
// eslint-disable-next-line
|
9273
9799
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9274
9800
|
if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked) {
|
9275
9801
|
this.isNodeClickCalled = false;
|
@@ -9288,7 +9814,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9288
9814
|
this.isNodeClickCalled = true;
|
9289
9815
|
this.isSameNodeClicked = false;
|
9290
9816
|
this.previousSelected = this.treeObj.selectedNodes;
|
9291
|
-
this.treeObj.selectedNodes = [args.node.getAttribute(
|
9817
|
+
this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
|
9292
9818
|
}
|
9293
9819
|
}
|
9294
9820
|
else if (this.previousSelected[0] !== args.node.getAttribute('data-uid')) {
|
@@ -9300,7 +9826,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9300
9826
|
// Opens the folder while clicking open context menu item in the treeview.
|
9301
9827
|
NavigationPane.prototype.openFileOnContextMenuClick = function (node) {
|
9302
9828
|
var data = this.treeObj.getTreeData(node);
|
9303
|
-
// eslint-disable-next-line
|
9304
9829
|
this.parent.selectedItems = [];
|
9305
9830
|
this.parent.itemData = data;
|
9306
9831
|
this.activeNode = node;
|
@@ -9329,7 +9854,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9329
9854
|
}
|
9330
9855
|
this.activeNode = args.node;
|
9331
9856
|
this.parent.activeModule = 'navigationpane';
|
9332
|
-
// eslint-disable-next-line
|
9333
9857
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9334
9858
|
this.parent.selectedItems = [];
|
9335
9859
|
this.parent.itemData = nodeData;
|
@@ -9354,7 +9878,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9354
9878
|
this.isPathDragged = this.isRenameParent = this.isRightClick = this.isSameNodeClicked = false;
|
9355
9879
|
};
|
9356
9880
|
/* istanbul ignore next */
|
9357
|
-
// eslint-disable-next-line
|
9358
9881
|
NavigationPane.prototype.onPathDrag = function (args) {
|
9359
9882
|
this.isPathDragged = true;
|
9360
9883
|
this.selectResultNode(args[0]);
|
@@ -9365,6 +9888,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9365
9888
|
return;
|
9366
9889
|
}
|
9367
9890
|
if (args.node.querySelector('.' + LIST_ITEM) === null) {
|
9891
|
+
this.isNodeExpandCalled = true;
|
9368
9892
|
var text = getValue('text', args.nodeData);
|
9369
9893
|
var id = args.node.getAttribute('data-id');
|
9370
9894
|
var isId = isNullOrUndefined(id) ? false : true;
|
@@ -9375,7 +9899,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9375
9899
|
this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
|
9376
9900
|
this.parent.pathId.push(getValue('id', args.nodeData));
|
9377
9901
|
read(this.parent, nodeExpand, path);
|
9378
|
-
this.isNodeExpandCalled = true;
|
9379
9902
|
}
|
9380
9903
|
};
|
9381
9904
|
/* istanbul ignore next */
|
@@ -9415,7 +9938,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9415
9938
|
};
|
9416
9939
|
NavigationPane.prototype.onPathChanged = function (args) {
|
9417
9940
|
this.parent.isCut = false;
|
9418
|
-
// eslint-disable-next-line
|
9419
9941
|
var currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
|
9420
9942
|
if (this.expandNodeTarget === 'add') {
|
9421
9943
|
var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
|
@@ -9520,14 +10042,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9520
10042
|
this.renameParent = null;
|
9521
10043
|
}
|
9522
10044
|
else {
|
9523
|
-
// eslint-disable-next-line
|
9524
10045
|
var resultData = [];
|
9525
10046
|
if (this.parent.hasId) {
|
9526
10047
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9527
10048
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9528
10049
|
}
|
9529
10050
|
else {
|
9530
|
-
// eslint-disable-next-line
|
9531
10051
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9532
10052
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.renameText, false));
|
9533
10053
|
if (nData.length > 0) {
|
@@ -9548,16 +10068,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9548
10068
|
this.updateTree(args);
|
9549
10069
|
}
|
9550
10070
|
else {
|
9551
|
-
// eslint-disable-next-line
|
9552
10071
|
var data = this.treeObj.getTreeData();
|
9553
|
-
// eslint-disable-next-line
|
9554
10072
|
var resultData = [];
|
9555
10073
|
if (this.parent.hasId) {
|
9556
10074
|
resultData = new DataManager(data).
|
9557
10075
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9558
10076
|
}
|
9559
10077
|
else {
|
9560
|
-
// eslint-disable-next-line
|
9561
10078
|
var nData = new DataManager(data).
|
9562
10079
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.currentItemText, false));
|
9563
10080
|
if (nData.length > 0) {
|
@@ -9613,7 +10130,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9613
10130
|
}
|
9614
10131
|
this.treeObj.removeNodes(moveNames);
|
9615
10132
|
};
|
9616
|
-
// eslint-disable-next-line
|
9617
10133
|
NavigationPane.prototype.getMoveNames = function (files, flag, path) {
|
9618
10134
|
var moveNames = [];
|
9619
10135
|
for (var i = 0; i < files.length; i++) {
|
@@ -9626,7 +10142,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9626
10142
|
name_2 = path.substring(index + 1);
|
9627
10143
|
path = path.substring(0, index + 1);
|
9628
10144
|
}
|
9629
|
-
// eslint-disable-next-line
|
9630
10145
|
var resultData = new DataManager(this.treeObj.getTreeData()).
|
9631
10146
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', name_2, false));
|
9632
10147
|
for (var j = 0; j < resultData.length; j++) {
|
@@ -9653,16 +10168,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9653
10168
|
this.treeObj.removeNodes(moveNames);
|
9654
10169
|
};
|
9655
10170
|
/* istanbul ignore next */
|
9656
|
-
// eslint-disable-next-line
|
9657
10171
|
NavigationPane.prototype.selectResultNode = function (resultObj) {
|
9658
10172
|
if (!this.parent.hasId) {
|
9659
10173
|
var path = getValue('filterPath', resultObj);
|
9660
10174
|
var itemname = getValue('name', resultObj);
|
9661
|
-
// eslint-disable-next-line
|
9662
10175
|
var data = new DataManager(this.treeObj.getTreeData()).
|
9663
10176
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', itemname, false));
|
9664
10177
|
if (data.length > 0) {
|
9665
|
-
// eslint-disable-next-line
|
9666
10178
|
var resultData = new DataManager(data).
|
9667
10179
|
executeLocal(new Query().where('filterPath', 'equal', path, false));
|
9668
10180
|
if (resultData.length > 0) {
|
@@ -9684,14 +10196,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9684
10196
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9685
10197
|
};
|
9686
10198
|
NavigationPane.prototype.onpasteEnd = function (args) {
|
9687
|
-
// eslint-disable-next-line
|
9688
10199
|
var resultData = [];
|
9689
10200
|
if (this.parent.hasId) {
|
9690
10201
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9691
10202
|
executeLocal(new Query().where('id', 'equal', getValue('id', args.cwd), false));
|
9692
10203
|
}
|
9693
10204
|
else {
|
9694
|
-
// eslint-disable-next-line
|
9695
10205
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9696
10206
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', getValue('name', args.cwd), false));
|
9697
10207
|
if (nData.length > 0) {
|
@@ -9713,6 +10223,9 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9713
10223
|
};
|
9714
10224
|
/* istanbul ignore next */
|
9715
10225
|
NavigationPane.prototype.checkDropPath = function (args) {
|
10226
|
+
if (isFileSystemData(this.parent) && this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane') {
|
10227
|
+
return;
|
10228
|
+
}
|
9716
10229
|
if (this.parent.hasId) {
|
9717
10230
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9718
10231
|
readDropPath(this.parent);
|
@@ -9731,8 +10244,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9731
10244
|
this.updateItemData();
|
9732
10245
|
}
|
9733
10246
|
this.moveNames = [];
|
9734
|
-
|
9735
|
-
var obj = this.parent.isDragDrop ? this.parent.dragData : this.parent.actionRecords;
|
10247
|
+
var obj = this.parent.isDragDrop || isFileSystemData(this.parent) ? this.parent.dragData : this.parent.actionRecords;
|
9736
10248
|
for (var i = 0; i < obj.length; i++) {
|
9737
10249
|
if (getValue('isFile', obj[i]) === false) {
|
9738
10250
|
this.moveNames.push(getValue('_fm_id', obj[i]));
|
@@ -9812,12 +10324,10 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9812
10324
|
/* istanbul ignore next */
|
9813
10325
|
NavigationPane.prototype.onDetailsInit = function () {
|
9814
10326
|
if (this.parent.activeModule === this.getModuleName()) {
|
9815
|
-
// eslint-disable-next-line
|
9816
10327
|
var dataobj = this.getTreeData(this.treeObj.selectedNodes[0]);
|
9817
10328
|
this.parent.itemData = dataobj;
|
9818
10329
|
}
|
9819
10330
|
};
|
9820
|
-
// eslint-disable-next-line
|
9821
10331
|
NavigationPane.prototype.onMenuItemData = function (args) {
|
9822
10332
|
if (this.parent.activeModule === this.getModuleName()) {
|
9823
10333
|
var liEle = closest(args.target, 'li');
|
@@ -9915,7 +10425,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9915
10425
|
break;
|
9916
10426
|
case 'f2':
|
9917
10427
|
if (this.parent.selectedItems.length === 0) {
|
9918
|
-
// eslint-disable-next-line
|
9919
10428
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9920
10429
|
if (!hasEditAccess(data)) {
|
9921
10430
|
createDeniedDialog(this.parent, data, permissionEdit);
|
@@ -9928,9 +10437,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9928
10437
|
break;
|
9929
10438
|
}
|
9930
10439
|
};
|
9931
|
-
// eslint-disable-next-line
|
9932
10440
|
NavigationPane.prototype.getTreeData = function (args) {
|
9933
|
-
// eslint-disable-next-line
|
9934
10441
|
var data = this.treeObj.getTreeData(args);
|
9935
10442
|
for (var i = 0; i < data.length; i++) {
|
9936
10443
|
if (isNullOrUndefined(getValue('hasChild', data[i]))) {
|
@@ -9944,7 +10451,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9944
10451
|
this.parent.currentItemText = getValue('name', this.parent.itemData[0]);
|
9945
10452
|
};
|
9946
10453
|
NavigationPane.prototype.updateItemData = function () {
|
9947
|
-
// eslint-disable-next-line
|
9948
10454
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9949
10455
|
this.parent.itemData = [data];
|
9950
10456
|
this.parent.isFile = false;
|
@@ -9966,6 +10472,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9966
10472
|
return NavigationPane;
|
9967
10473
|
}());
|
9968
10474
|
|
10475
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9969
10476
|
/**
|
9970
10477
|
* DetailsView module
|
9971
10478
|
*/
|
@@ -9992,7 +10499,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
9992
10499
|
this.isNameWidth = false;
|
9993
10500
|
this.pasteOperation = false;
|
9994
10501
|
this.uploadOperation = false;
|
9995
|
-
Grid.Inject(Resize, ContextMenu$
|
10502
|
+
Grid.Inject(Resize, ContextMenu$2, Sort, VirtualScroll);
|
9996
10503
|
this.parent = parent;
|
9997
10504
|
this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
|
9998
10505
|
this.addEventListener();
|
@@ -10039,7 +10546,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10039
10546
|
showSpinner(this.parent.element);
|
10040
10547
|
if (this.parent.view === 'Details') {
|
10041
10548
|
removeClass([this.parent.element], MULTI_SELECT);
|
10042
|
-
// eslint-disable-next-line
|
10043
10549
|
var items = getSortedData(this.parent, args.files);
|
10044
10550
|
this.checkNameWidth();
|
10045
10551
|
var columns = this.getColumns();
|
@@ -10080,8 +10586,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10080
10586
|
width: '100%',
|
10081
10587
|
height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
|
10082
10588
|
beforeCopy: function (args) { args.cancel = true; },
|
10083
|
-
|
10084
|
-
load: function (args) {
|
10589
|
+
load: function () {
|
10085
10590
|
this.focusModule.destroy();
|
10086
10591
|
},
|
10087
10592
|
locale: this.parent.locale
|
@@ -10099,18 +10604,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10099
10604
|
}
|
10100
10605
|
};
|
10101
10606
|
DetailsView.prototype.reactTemplateRender = function (args) {
|
10102
|
-
this.parent[
|
10607
|
+
this.parent['portals'] = args;
|
10103
10608
|
if (this.parent.portals && this.parent.toolbarModule && this.parent.toolbarModule.toolbarObj &&
|
10104
10609
|
this.parent.toolbarModule.toolbarObj.portals) {
|
10105
|
-
this.parent[
|
10610
|
+
this.parent['portals'] = this.parent['portals'].concat(this.parent.toolbarModule.toolbarObj.portals);
|
10106
10611
|
}
|
10107
|
-
this.parent.notify('renderReactTemplate', this.parent[
|
10108
|
-
this.parent[
|
10612
|
+
this.parent.notify('renderReactTemplate', this.parent['portals']);
|
10613
|
+
this.parent['renderReactTemplates']();
|
10109
10614
|
};
|
10110
10615
|
/**
|
10111
10616
|
* Gets the grid height.
|
10112
10617
|
*
|
10113
|
-
* @returns The grid height.
|
10618
|
+
* @returns {number} - The grid height.
|
10114
10619
|
* @private
|
10115
10620
|
*/
|
10116
10621
|
DetailsView.prototype.getGridHeight = function () {
|
@@ -10188,7 +10693,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10188
10693
|
return "<span class=\"e-fe-icon " + data._fm_iconClass + "\"></span>";
|
10189
10694
|
}), allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
|
10190
10695
|
headerTemplate: initializeCSPTemplate(function () {
|
10191
|
-
return
|
10696
|
+
return '<span class=\'e-fe-icon e-fe-folder\'></span>';
|
10192
10697
|
})
|
10193
10698
|
};
|
10194
10699
|
columns.unshift(icon);
|
@@ -10247,7 +10752,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10247
10752
|
}
|
10248
10753
|
}
|
10249
10754
|
if (!this.parent.showFileExtension && getValue('isFile', args.data)) {
|
10250
|
-
var
|
10755
|
+
var text = getValue('name', args.data);
|
10756
|
+
var textEle = args.row.querySelector('[title= "' + text + '"]');
|
10251
10757
|
if (textEle) {
|
10252
10758
|
var name_1 = getValue('name', args.data);
|
10253
10759
|
var type = getValue('type', args.data);
|
@@ -10281,7 +10787,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10281
10787
|
var dateEle = args.row.querySelector('.e-fe-date');
|
10282
10788
|
var intl = new Internationalization(this.parent.locale);
|
10283
10789
|
var columns = this.parent.detailsViewSettings.columns;
|
10284
|
-
// eslint-disable-next-line
|
10285
10790
|
var format = void 0;
|
10286
10791
|
for (var i = 0; i < columns.length; i++) {
|
10287
10792
|
if (columns[i].field === 'dateModified') {
|
@@ -10317,7 +10822,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10317
10822
|
var len = rows.length;
|
10318
10823
|
this.sortSelectedNodes = [];
|
10319
10824
|
while (len > 0) {
|
10320
|
-
// eslint-disable-next-line
|
10321
10825
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
10322
10826
|
this.sortSelectedNodes.push(getValue(this.parent.hasId ? 'id' : 'name', data));
|
10323
10827
|
len--;
|
@@ -10337,8 +10841,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10337
10841
|
showSpinner(this.parent.element);
|
10338
10842
|
var nameColumn = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === _this.parent.sortBy; });
|
10339
10843
|
if (nameColumn && !('sortComparer' in nameColumn)) {
|
10340
|
-
|
10341
|
-
|
10844
|
+
var items = getSortedData(this.parent, (this.parent.enableVirtualization)
|
10845
|
+
? args.result
|
10846
|
+
: this.gridObj.dataSource);
|
10342
10847
|
args.result = items;
|
10343
10848
|
}
|
10344
10849
|
};
|
@@ -10347,7 +10852,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10347
10852
|
this.createDragObj();
|
10348
10853
|
if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
|
10349
10854
|
((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
|
10350
|
-
this.element.querySelector('.e-content').scrollTop
|
10855
|
+
this.element.querySelector('.e-content').scrollTop === 0))) {
|
10351
10856
|
this.selectRecords(this.parent.selectedItems);
|
10352
10857
|
}
|
10353
10858
|
if (this.isPasteOperation === true) {
|
@@ -10420,7 +10925,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10420
10925
|
this.isLoaded = false;
|
10421
10926
|
};
|
10422
10927
|
DetailsView.prototype.selectRecords = function (nodes) {
|
10423
|
-
// eslint-disable-next-line
|
10424
10928
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
10425
10929
|
var sRecords = [];
|
10426
10930
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
@@ -10428,7 +10932,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10428
10932
|
if (nodes.indexOf(node) !== -1) {
|
10429
10933
|
sRecords.push(i);
|
10430
10934
|
}
|
10431
|
-
else if (!this.parent.showFileExtension && node.includes('.')) {
|
10935
|
+
else if (!this.parent.showFileExtension && !this.parent.hasId && node.includes('.')) {
|
10432
10936
|
var Str2 = node.split('.').slice(0, -1).join('.');
|
10433
10937
|
if (nodes.indexOf(Str2) !== -1) {
|
10434
10938
|
sRecords.push(i);
|
@@ -10440,18 +10944,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10440
10944
|
this.addFocus(this.gridObj.selectedRowIndex);
|
10441
10945
|
}
|
10442
10946
|
};
|
10443
|
-
// eslint-disable-next-line
|
10444
10947
|
DetailsView.prototype.addSelection = function (data) {
|
10445
|
-
// eslint-disable-next-line
|
10446
10948
|
var items = this.gridObj.getCurrentViewRecords();
|
10447
|
-
// eslint-disable-next-line
|
10448
10949
|
var rData = [];
|
10449
10950
|
if (this.parent.hasId) {
|
10450
10951
|
rData = new DataManager(items).
|
10451
10952
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
10452
10953
|
}
|
10453
10954
|
else {
|
10454
|
-
// eslint-disable-next-line
|
10455
10955
|
var nData = new DataManager(items).
|
10456
10956
|
executeLocal(new Query().where('name', 'equal', getValue('name', data), false));
|
10457
10957
|
if (nData.length > 0) {
|
@@ -10469,7 +10969,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10469
10969
|
this.gridObj.sortModule.sortColumn(this.parent.sortBy, this.parent.sortOrder);
|
10470
10970
|
}
|
10471
10971
|
else {
|
10472
|
-
// eslint-disable-next-line
|
10473
10972
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10474
10973
|
}
|
10475
10974
|
if (this.element.querySelector('.e-content').scrollTop !== 0) {
|
@@ -10566,10 +11065,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10566
11065
|
var len = this.gridObj.columns.length;
|
10567
11066
|
var columnData = JSON.parse(JSON.stringify(this.gridObj.columns));
|
10568
11067
|
if (columnData[len - 1].field && columnData[len - 1].field !== 'filterPath' && !this.parent.isMobile) {
|
10569
|
-
var pathColumn
|
11068
|
+
var pathColumn = {
|
10570
11069
|
field: 'filterPath', headerText: getLocaleText(this.parent, 'Path'), minWidth: 180, width: 'auto'
|
10571
11070
|
};
|
10572
|
-
this.gridObj.columns.push(pathColumn
|
11071
|
+
this.gridObj.columns.push(pathColumn);
|
10573
11072
|
this.adjustWidth(this.gridObj.columns, 'filterPath');
|
10574
11073
|
this.adjustWidth(this.gridObj.columns, 'name');
|
10575
11074
|
this.isColumnRefresh = true;
|
@@ -10577,7 +11076,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10577
11076
|
}
|
10578
11077
|
};
|
10579
11078
|
DetailsView.prototype.checkEmptyDiv = function (args) {
|
10580
|
-
// eslint-disable-next-line
|
10581
11079
|
var items = getSortedData(this.parent, args.files);
|
10582
11080
|
if (items.length === 0 && !isNullOrUndefined(this.element.querySelector('.' + GRID_VIEW))) {
|
10583
11081
|
createEmptyElement(this.parent, this.element, args);
|
@@ -10594,21 +11092,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10594
11092
|
};
|
10595
11093
|
DetailsView.prototype.onOpenInit = function () {
|
10596
11094
|
if (this.parent.activeModule === 'detailsview') {
|
10597
|
-
// eslint-disable-next-line
|
10598
11095
|
var data = this.gridObj.getSelectedRecords()[0];
|
10599
11096
|
this.openContent(data);
|
10600
11097
|
}
|
10601
11098
|
};
|
10602
11099
|
DetailsView.prototype.DblClickEvents = function (args) {
|
10603
11100
|
this.gridObj.selectRows([args.rowIndex]);
|
10604
|
-
// eslint-disable-next-line
|
10605
11101
|
var data;
|
10606
11102
|
if (args.rowData) {
|
10607
11103
|
data = JSON.parse(JSON.stringify(args.rowData));
|
10608
11104
|
this.openContent(data);
|
10609
11105
|
}
|
10610
11106
|
};
|
10611
|
-
// eslint-disable-next-line
|
10612
11107
|
DetailsView.prototype.openContent = function (data) {
|
10613
11108
|
var _this = this;
|
10614
11109
|
if (!hasReadAccess(data)) {
|
@@ -10705,7 +11200,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10705
11200
|
this.gridObj.sortColumn('name', this.parent.sortOrder);
|
10706
11201
|
}
|
10707
11202
|
else {
|
10708
|
-
// eslint-disable-next-line
|
10709
11203
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10710
11204
|
}
|
10711
11205
|
this.parent.notify(sortByChange, {});
|
@@ -10894,7 +11388,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10894
11388
|
this.parent.off(updateSelectionData, this.onUpdateSelectionData);
|
10895
11389
|
};
|
10896
11390
|
DetailsView.prototype.onActionFailure = function () { this.interaction = true; };
|
10897
|
-
// eslint-disable-next-line
|
10898
11391
|
DetailsView.prototype.onMenuItemData = function (args) {
|
10899
11392
|
if (this.parent.activeModule === this.getModuleName()) {
|
10900
11393
|
this.parent.itemData = [this.gridObj.getRowInfo(args.target).rowData];
|
@@ -10935,7 +11428,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10935
11428
|
getModule(this.parent, dragLi);
|
10936
11429
|
this.parent.activeElements = [];
|
10937
11430
|
this.parent.dragData = [];
|
10938
|
-
// eslint-disable-next-line
|
10939
11431
|
this.parent.dragData = this.gridObj.getSelectedRecords();
|
10940
11432
|
var dragRow;
|
10941
11433
|
if (this.parent.dragData.length === 0 && dragLi) {
|
@@ -11024,16 +11516,13 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11024
11516
|
DetailsView.prototype.onDropInit = function (args) {
|
11025
11517
|
if (this.parent.targetModule === this.getModuleName()) {
|
11026
11518
|
/* istanbul ignore next */
|
11027
|
-
// eslint-disable-next-line
|
11028
11519
|
var cwdData = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feParent);
|
11029
11520
|
if (!args.target.closest('tr')) {
|
11030
11521
|
this.parent.dropPath = this.parent.path;
|
11031
11522
|
this.parent.dropData = cwdData;
|
11032
11523
|
}
|
11033
11524
|
else {
|
11034
|
-
// eslint-disable-next-line
|
11035
11525
|
var info = null;
|
11036
|
-
// eslint-disable-next-line
|
11037
11526
|
info = this.gridObj.getRowInfo(args.target).rowData;
|
11038
11527
|
this.parent.dropPath = info.isFile ? this.parent.path : getFullPath(this.parent, info, this.parent.path);
|
11039
11528
|
this.parent.dropData = info.isFile ? cwdData : info;
|
@@ -11135,7 +11624,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11135
11624
|
this.parent.currentItemText = getValue('name', args.data);
|
11136
11625
|
}
|
11137
11626
|
else if (len > 0) {
|
11138
|
-
// eslint-disable-next-line
|
11139
11627
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
11140
11628
|
this.parent.currentItemText = getValue('name', data);
|
11141
11629
|
}
|
@@ -11165,7 +11653,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11165
11653
|
};
|
11166
11654
|
DetailsView.prototype.selectedRecords = function () {
|
11167
11655
|
this.parent.setProperties({ selectedItems: [] }, true);
|
11168
|
-
// eslint-disable-next-line
|
11169
11656
|
var selectedRecords = this.gridSelectNodes();
|
11170
11657
|
var selectSize = 0;
|
11171
11658
|
while (selectSize < selectedRecords.length) {
|
@@ -11229,28 +11716,27 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11229
11716
|
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
11230
11717
|
};
|
11231
11718
|
DetailsView.prototype.wireClickEvent = function (toBind) {
|
11719
|
+
var _this = this;
|
11232
11720
|
if (toBind) {
|
11233
|
-
// eslint-disable-next-line
|
11234
|
-
var proxy_1 = this;
|
11235
11721
|
var ele = this.gridObj.getContent();
|
11236
11722
|
this.clickObj = new Touch(ele, {
|
11237
11723
|
tap: function (eve) {
|
11238
11724
|
if (eve.tapCount === 1 && eve.originalEvent.target.classList.contains('e-content')) {
|
11239
|
-
|
11725
|
+
_this.onClearAllInit();
|
11240
11726
|
}
|
11241
11727
|
},
|
11242
11728
|
tapHold: function (e) {
|
11243
|
-
if (
|
11729
|
+
if (_this.parent.isDevice) {
|
11244
11730
|
e.originalEvent.preventDefault();
|
11245
|
-
if (
|
11246
|
-
setValue('enableSelectMultiTouch',
|
11247
|
-
addClass([
|
11731
|
+
if (_this.parent.allowMultiSelection) {
|
11732
|
+
setValue('enableSelectMultiTouch', _this.parent.allowMultiSelection, _this.gridObj.selectionModule);
|
11733
|
+
addClass([_this.parent.element], MULTI_SELECT);
|
11248
11734
|
}
|
11249
11735
|
var target = e.originalEvent.target;
|
11250
11736
|
if (target) {
|
11251
11737
|
var row = closest(target, '.' + ROW);
|
11252
|
-
var index =
|
11253
|
-
|
11738
|
+
var index = _this.gridObj.getRows().indexOf(row);
|
11739
|
+
_this.gridObj.selectRow(index);
|
11254
11740
|
}
|
11255
11741
|
}
|
11256
11742
|
}
|
@@ -11294,7 +11780,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11294
11780
|
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
11295
11781
|
};
|
11296
11782
|
/* istanbul ignore next */
|
11297
|
-
// eslint:disable-next-line
|
11298
11783
|
DetailsView.prototype.keydownHandler = function (e) {
|
11299
11784
|
if (!this.isRendered) {
|
11300
11785
|
return;
|
@@ -11333,26 +11818,20 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11333
11818
|
case 'ctrlD':
|
11334
11819
|
e.preventDefault();
|
11335
11820
|
break;
|
11336
|
-
default:
|
11337
|
-
break;
|
11338
11821
|
}
|
11339
11822
|
};
|
11340
11823
|
/* istanbul ignore next */
|
11341
|
-
// eslint:disable-next-line
|
11342
11824
|
DetailsView.prototype.keyupHandler = function (e) {
|
11343
11825
|
if (!this.isRendered) {
|
11344
11826
|
return;
|
11345
11827
|
}
|
11346
11828
|
e.preventDefault();
|
11347
11829
|
var action = e.action;
|
11348
|
-
// eslint-disable-next-line
|
11349
11830
|
var gridItems = getSortedData(this.parent, this.gridObj.dataSource);
|
11350
11831
|
var gridLength = gridItems.length;
|
11351
|
-
var focItem = this.getFocusedItem();
|
11352
11832
|
var focIndex = this.getFocusedItemIndex();
|
11353
11833
|
var selIndex = this.gridObj.selectedRowIndex;
|
11354
11834
|
var selRowIndeces = this.gridObj.getSelectedRowIndexes();
|
11355
|
-
// eslint-disable-next-line
|
11356
11835
|
var rowData;
|
11357
11836
|
var firstItem;
|
11358
11837
|
var lastItem;
|
@@ -11382,7 +11861,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11382
11861
|
}
|
11383
11862
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
11384
11863
|
if (rowData) {
|
11385
|
-
// eslint-disable-next-line
|
11386
11864
|
var data = JSON.parse(JSON.stringify(rowData));
|
11387
11865
|
this.openContent(data);
|
11388
11866
|
}
|
@@ -11499,14 +11977,12 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11499
11977
|
break;
|
11500
11978
|
}
|
11501
11979
|
};
|
11502
|
-
// eslint-disable-next-line
|
11503
11980
|
DetailsView.prototype.gridSelectNodes = function () {
|
11504
11981
|
return this.gridObj.getSelectedRecords();
|
11505
11982
|
};
|
11506
11983
|
DetailsView.prototype.doDownload = function () {
|
11507
11984
|
if (this.parent.selectedItems.length !== 0) {
|
11508
11985
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11509
|
-
// eslint-disable-next-line
|
11510
11986
|
var items = this.parent.itemData;
|
11511
11987
|
for (var i = 0; i < items.length; i++) {
|
11512
11988
|
if (!hasDownloadAccess(items[i])) {
|
@@ -11520,7 +11996,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11520
11996
|
DetailsView.prototype.performDelete = function () {
|
11521
11997
|
if (this.parent.selectedItems && this.parent.selectedItems.length > 0) {
|
11522
11998
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11523
|
-
// eslint-disable-next-line
|
11524
11999
|
var items = this.parent.itemData;
|
11525
12000
|
for (var i = 0; i < items.length; i++) {
|
11526
12001
|
if (!hasEditAccess(items[i])) {
|
@@ -11538,11 +12013,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11538
12013
|
}
|
11539
12014
|
};
|
11540
12015
|
DetailsView.prototype.updateRenameData = function () {
|
11541
|
-
// eslint-disable-next-line
|
11542
12016
|
var data = this.gridSelectNodes()[0];
|
11543
12017
|
updateRenamingData(this.parent, data);
|
11544
12018
|
};
|
11545
|
-
// eslint-disable-next-line
|
11546
12019
|
DetailsView.prototype.shiftMoveMethod = function (gridItems, selIndex, focIndex, selRowIndeces, e) {
|
11547
12020
|
if (!this.parent.allowMultiSelection) {
|
11548
12021
|
this.moveFunction(gridItems, e, selIndex);
|
@@ -11560,7 +12033,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11560
12033
|
}
|
11561
12034
|
}
|
11562
12035
|
};
|
11563
|
-
// eslint-disable-next-line
|
11564
12036
|
DetailsView.prototype.moveFunction = function (selectedItems, e, rowIndex) {
|
11565
12037
|
if (!isNullOrUndefined(this.getFocusedItem()) && this.parent.allowMultiSelection) {
|
11566
12038
|
if (e.action === 'moveDown') {
|
@@ -11607,7 +12079,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11607
12079
|
this.gridObj.selectRow(selIndex);
|
11608
12080
|
}
|
11609
12081
|
};
|
11610
|
-
// eslint-disable-next-line
|
11611
12082
|
DetailsView.prototype.ctrlMoveFunction = function (items, e, rowIndex) {
|
11612
12083
|
var nextItem;
|
11613
12084
|
if (!isNullOrUndefined(this.getFocusedItem())) {
|
@@ -11626,7 +12097,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11626
12097
|
}
|
11627
12098
|
this.addFocus(nextItem);
|
11628
12099
|
};
|
11629
|
-
// eslint-disable-next-line
|
11630
12100
|
DetailsView.prototype.checkRowsKey = function (items, indexValue, focIndex, e) {
|
11631
12101
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
11632
12102
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
@@ -11750,7 +12220,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11750
12220
|
}
|
11751
12221
|
return check;
|
11752
12222
|
};
|
11753
|
-
// eslint-disable-next-line
|
11754
12223
|
DetailsView.prototype.shiftSelectedItem = function (selIndex, selRowIndexes, gridItems, e) {
|
11755
12224
|
if (selIndex === -1) {
|
11756
12225
|
this.gridObj.selectRow(0);
|
@@ -11799,7 +12268,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11799
12268
|
}
|
11800
12269
|
}
|
11801
12270
|
};
|
11802
|
-
// eslint-disable-next-line
|
11803
12271
|
DetailsView.prototype.onMethodCall = function (e) {
|
11804
12272
|
if (this.parent.view !== 'Details') {
|
11805
12273
|
return;
|
@@ -11832,17 +12300,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11832
12300
|
break;
|
11833
12301
|
}
|
11834
12302
|
};
|
11835
|
-
// eslint-disable-next-line
|
11836
12303
|
DetailsView.prototype.getRecords = function (nodes) {
|
11837
|
-
// eslint-disable-next-line
|
11838
12304
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
11839
|
-
// eslint-disable-next-line
|
11840
12305
|
var records = [];
|
11841
12306
|
var hasFilter = (this.parent.breadcrumbbarModule.searchObj.element.value !== '' || this.parent.isFiltered) ? true : false;
|
11842
|
-
var filter
|
12307
|
+
var filter = this.parent.hasId ? 'id' : 'name';
|
11843
12308
|
if (this.parent.hasId || !hasFilter) {
|
11844
12309
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
11845
|
-
if (nodes.indexOf(getValue(filter
|
12310
|
+
if (nodes.indexOf(getValue(filter, gridRecords[i])) !== -1) {
|
11846
12311
|
records.push(gridRecords[i]);
|
11847
12312
|
}
|
11848
12313
|
}
|
@@ -11863,12 +12328,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11863
12328
|
this.performDelete();
|
11864
12329
|
return;
|
11865
12330
|
}
|
11866
|
-
// eslint-disable-next-line
|
11867
12331
|
var records = this.getRecords(ids);
|
11868
12332
|
if (records.length === 0) {
|
11869
12333
|
return;
|
11870
12334
|
}
|
11871
|
-
// eslint-disable-next-line
|
11872
12335
|
var data = [];
|
11873
12336
|
var newIds = [];
|
11874
12337
|
for (var i = 0; i < records.length; i++) {
|
@@ -11882,12 +12345,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11882
12345
|
this.doDownload();
|
11883
12346
|
return;
|
11884
12347
|
}
|
11885
|
-
// eslint-disable-next-line
|
11886
12348
|
var dRecords = this.getRecords(ids);
|
11887
12349
|
if (dRecords.length === 0) {
|
11888
12350
|
return;
|
11889
12351
|
}
|
11890
|
-
// eslint-disable-next-line
|
11891
12352
|
var data = [];
|
11892
12353
|
var newIds = [];
|
11893
12354
|
for (var i = 0; i < dRecords.length; i++) {
|
@@ -11900,7 +12361,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11900
12361
|
if (isNullOrUndefined(id)) {
|
11901
12362
|
return;
|
11902
12363
|
}
|
11903
|
-
// eslint-disable-next-line
|
11904
12364
|
var records = this.getRecords([id]);
|
11905
12365
|
if (records.length > 0) {
|
11906
12366
|
this.openContent(records[0]);
|
@@ -11912,7 +12372,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11912
12372
|
this.performRename();
|
11913
12373
|
return;
|
11914
12374
|
}
|
11915
|
-
// eslint-disable-next-line
|
11916
12375
|
var records = this.getRecords([id]);
|
11917
12376
|
if (records.length > 0) {
|
11918
12377
|
updateRenamingData(this.parent, records[0]);
|
@@ -11932,21 +12391,5 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11932
12391
|
return DetailsView;
|
11933
12392
|
}());
|
11934
12393
|
|
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 };
|
12394
|
+
export { ACTIVE, ALT_DIALOG_ID, AjaxSettings, BLUR, BREADCRUMBBAR_ID, BREADCRUMBS, BreadCrumbBar, CB_WRAP, CHECK, CHECK_SELECT, CLONE, COLLAPSED, CONTENT_ID, CONTEXT_MENU_ID, CONTROL, Column, ContextMenu, ContextMenuSettings, DETAILS_LABEL, DIALOG_ID, DISPLAY_NONE, DROP_FILE, DROP_FOLDER, Delete, DetailsView, DetailsViewSettings, Download, EMPTY, EMPTY_CONTENT, EMPTY_INNER_CONTENT, ERROR_CONTENT, EXTN_DIALOG_ID, FILTER, FOCUS, FOCUSED, FOLDER, FRAME, FULLROW, FileManager, GRID_CONTENT, GRID_HEADER, GRID_ID, GRID_VIEW, GetDetails, HEADER_CHECK, HOVER, ICONS, ICON_BREADCRUMB, ICON_CLEAR, ICON_COLLAPSIBLE, ICON_COPY, ICON_CUT, ICON_DELETE, ICON_DETAILS, ICON_DOWNLOAD, ICON_DROP_IN, ICON_DROP_OUT, ICON_GRID, ICON_IMAGE, ICON_LARGE, ICON_MUSIC, ICON_NEWFOLDER, ICON_NO_DROP, ICON_OPEN, ICON_OPTIONS, ICON_PASTE, ICON_REFRESH, ICON_RENAME, ICON_SELECTALL, ICON_SHORTBY, ICON_UPLOAD, ICON_VIDEO, ICON_VIEW, IMG_DIALOG_ID, LARGEICON_ID, LARGE_EMPTY_FOLDER, LARGE_EMPTY_FOLDER_TWO, LARGE_ICON, LARGE_ICONS, LARGE_ICON_FOLDER, LAYOUT, LAYOUT_CONTENT, LAYOUT_ID, LIST_ITEM, LIST_PARENT, LIST_TEXT, LargeIconsView, MENU_ICON, MENU_ITEM, MOBILE, MOB_POPUP, MULTI_SELECT, NAVIGATION, NAVIGATION_ID, NavigationPane, NavigationPaneSettings, OVERLAY, RETRY_DIALOG_ID, RETRY_ID, ROOT, ROOT_POPUP, ROW, ROWCELL, RTL, SEARCH_ID, SELECTED_ITEMS, SORTBY_ID, SPLITTER_ID, SPLIT_BAR, STATUS, SUBMENU_ICON, Search, SearchSettings, TB_ITEM, TB_OPTION_DOT, TB_OPTION_TICK, TEMPLATE_CELL, TEXT_CONTENT, TOOLBAR_ID, TREE_ID, TREE_VIEW, Toolbar, ToolbarItem, ToolbarSettings, UPLOAD_DIALOG_ID, UPLOAD_ID, UploadSettings, VALUE, VIEW_ID, Virtualization, actionFailure, activeElement, addBlur, afterRequest, beforeDelete, beforeDownload, beforeRequest, clearAllInit, clearPathInit, closePopup, columnArray, copyFiles, createDeniedDialog, createDialog, createEmptyElement, createEnd, createExtDialog, createFolder, createImageDialog, createNewFolder, createVirtualDragElement, cutCopyInit, cutEnd, cutFiles, defaultToolbarItems, deleteEnd, deleteInit, destroy, detailsInit, doDeleteFiles, doDownload, doDownloadFiles, doPasteUpdate, doRename, download, downloadInit, dragCancel, dragEnd, dragHelper, dragStartHandler, dragStopHandler, dragging, draggingHandler, dropHandler, dropInit, dropPath, fileItems, fileType, filter, filterEnd, finalizeEnd, folderItems, generatePath, getAccessClass, getAccessDetails, getCssClass, getDirectories, getDirectoryPath, getDuplicateData, getFullPath, getImageUrl, getItemName, getLocaleText, getModule, getName, getObject, getParentPath, getParents, getPath, getPathId, getPathNames, getPathObject, getSortField, getSortedData, getTargetModule, hasContentAccess, hasDownloadAccess, hasEditAccess, hasReadAccess, hasUploadAccess, hideLayout, hidePaste, initialEnd, isFile, isFileSystemData, layoutChange, layoutItems, layoutRefresh, menuItemData, methodCall, modelChanged, nodeExpand, objectToString, openAction, openEnd, openInit, openSearchFolder, paste, pasteEnd, pasteHandler, pasteInit, pathChanged, pathColumn, pathDrag, permissionCopy, permissionDownload, permissionEdit, permissionEditContents, permissionRead, permissionUpload, read, readDropPath, refresh, refreshEnd, removeActive, removeBlur, removeDropTarget, removeItemClass, rename, renameEnd, renameEndParent, renameInit, resizeEnd, scrollHandler, search, searchTextChange, searchWordHandler, selectAllInit, selectedData, selectionChanged, setDateObject, setNextPath, setNodeId, showPaste, skipUpload, sortByChange, sortColumn, sortComparer, sortbyClickHandler, splitterResize, treeSelect, updateLayout, updatePath, updateRenamingData, updateSelectionData, updateTreeSelection, upload, uploadItem, validateSubFolder };
|
11952
12395
|
//# sourceMappingURL=ej2-filemanager.es5.js.map
|