@syncfusion/ej2-filemanager 24.2.7 → 25.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -25
- 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 +213 -51
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +222 -54
- 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/toolbar.js +16 -5
- package/src/file-manager/base/file-manager-model.d.ts +12 -1
- package/src/file-manager/base/file-manager.d.ts +11 -0
- package/src/file-manager/base/file-manager.js +13 -5
- package/src/file-manager/base/interface.d.ts +18 -0
- package/src/file-manager/common/operations.js +70 -14
- package/src/file-manager/common/utility.d.ts +9 -0
- package/src/file-manager/common/utility.js +32 -0
- package/src/file-manager/index.d.ts +1 -0
- package/src/file-manager/index.js +1 -0
- package/src/file-manager/layout/details-view.d.ts +1 -1
- package/src/file-manager/layout/details-view.js +71 -24
- package/src/file-manager/layout/large-icons-view.d.ts +1 -0
- package/src/file-manager/layout/large-icons-view.js +16 -2
- package/src/file-manager/layout/navigation-pane.js +0 -1
- package/src/file-manager/models/column-model.d.ts +11 -1
- package/src/file-manager/models/column.d.ts +10 -0
- package/src/file-manager/models/column.js +3 -0
- package/src/file-manager/models/details-view-settings.js +1 -3
- package/styles/bootstrap-dark.css +1 -2
- package/styles/bootstrap.css +1 -2
- package/styles/bootstrap4.css +1 -2
- package/styles/bootstrap5-dark.css +1 -2
- package/styles/bootstrap5.css +1 -2
- package/styles/fabric-dark.css +2 -3
- package/styles/fabric.css +2 -3
- package/styles/file-manager/_bds-definition.scss +234 -0
- package/styles/file-manager/_layout.scss +2 -3
- package/styles/file-manager/bootstrap-dark.css +1 -2
- package/styles/file-manager/bootstrap.css +1 -2
- package/styles/file-manager/bootstrap4.css +1 -2
- package/styles/file-manager/bootstrap5-dark.css +1 -2
- package/styles/file-manager/bootstrap5.css +1 -2
- package/styles/file-manager/fabric-dark.css +2 -3
- package/styles/file-manager/fabric.css +2 -3
- package/styles/file-manager/fluent-dark.css +1 -2
- package/styles/file-manager/fluent.css +1 -2
- package/styles/file-manager/highcontrast-light.css +1 -2
- package/styles/file-manager/highcontrast.css +1 -2
- package/styles/file-manager/icons/_bds.scss +235 -0
- package/styles/file-manager/material-dark.css +1 -2
- package/styles/file-manager/material.css +1 -2
- package/styles/file-manager/material3-dark.css +1 -2
- package/styles/file-manager/material3.css +1 -2
- package/styles/file-manager/tailwind-dark.css +1 -2
- package/styles/file-manager/tailwind.css +1 -2
- package/styles/fluent-dark.css +1 -2
- package/styles/fluent.css +1 -2
- package/styles/highcontrast-light.css +1 -2
- package/styles/highcontrast.css +1 -2
- package/styles/material-dark.css +1 -2
- package/styles/material.css +1 -2
- package/styles/material3-dark.css +1 -2
- package/styles/material3.css +1 -2
- package/styles/tailwind-dark.css +1 -2
- package/styles/tailwind.css +1 -2
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Ajax, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, createElement, detach, extend, formatUnit, getUniqueID, getValue, initializeCSPTemplate, isNullOrUndefined, isVisible, matches, remove, removeClass, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
1
|
+
import { Ajax, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, Fetch, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, closest, createElement, detach, extend, formatUnit, getUniqueID, getValue, initializeCSPTemplate, isNullOrUndefined, isVisible, matches, remove, removeClass, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
2
2
|
import { Splitter } from '@syncfusion/ej2-layouts';
|
3
3
|
import { Dialog, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
4
|
-
import { DataManager, Query } from '@syncfusion/ej2-data';
|
4
|
+
import { DataManager, DataUtil, Query } from '@syncfusion/ej2-data';
|
5
5
|
import { Input, TextBox, Uploader } from '@syncfusion/ej2-inputs';
|
6
6
|
import { CheckBox, createCheckBox } from '@syncfusion/ej2-buttons';
|
7
7
|
import { ListBase } from '@syncfusion/ej2-lists';
|
@@ -217,9 +217,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
217
217
|
var columnArray = [
|
218
218
|
{
|
219
219
|
field: 'name', headerText: 'Name', minWidth: 120, isPrimaryKey: true,
|
220
|
-
template:
|
221
|
-
return "<span class=\"e-fe-text\">" + data.name + "</span>";
|
222
|
-
}),
|
220
|
+
template: '<span class=\"e-fe-text\">${name}</span>',
|
223
221
|
customAttributes: { class: 'e-fe-grid-name' }
|
224
222
|
},
|
225
223
|
{
|
@@ -445,6 +443,9 @@ var Column = /** @__PURE__ @class */ (function (_super) {
|
|
445
443
|
__decorate$7([
|
446
444
|
Property(null)
|
447
445
|
], Column.prototype, "template", void 0);
|
446
|
+
__decorate$7([
|
447
|
+
Property(null)
|
448
|
+
], Column.prototype, "sortComparer", void 0);
|
448
449
|
__decorate$7([
|
449
450
|
Property(null)
|
450
451
|
], Column.prototype, "headerTemplate", void 0);
|
@@ -835,6 +836,38 @@ var permissionUpload = 'upload';
|
|
835
836
|
/** @hidden */
|
836
837
|
var permissionDownload = 'download';
|
837
838
|
|
839
|
+
/**
|
840
|
+
* Utility function to compare two strings in a way similar to Windows Explorer.
|
841
|
+
* Files and folders are sorted separately, with folders coming before files.
|
842
|
+
*
|
843
|
+
* @param {string} reference - The first string to compare. This could be a file or folder name.
|
844
|
+
* @param {string} comparer - The second string to compare. This could be a file or folder name.
|
845
|
+
* @returns {number} - A negative number if `reference` should come before `comparer`, a positive number if `comparer` should come before `reference`, and 0 if they are considered equal.
|
846
|
+
*/
|
847
|
+
function sortComparer(reference, comparer) {
|
848
|
+
// Check if reference and comparer are files or folders
|
849
|
+
var referenceIsFile = /\.\S+/.test(reference);
|
850
|
+
var comparerIsFile = /\.\S+/.test(comparer);
|
851
|
+
// If one is a file and the other is a folder, the folder should come first
|
852
|
+
if (referenceIsFile && !comparerIsFile)
|
853
|
+
return 1;
|
854
|
+
if (!referenceIsFile && comparerIsFile)
|
855
|
+
return -1;
|
856
|
+
var referenceParts = [];
|
857
|
+
var comparerParts = [];
|
858
|
+
(reference + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { referenceParts.push([$1 || Infinity, $2 || ""]); return ""; });
|
859
|
+
(comparer + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { comparerParts.push([$1 || Infinity, $2 || ""]); return ""; });
|
860
|
+
// Compare each part of reference and comparer
|
861
|
+
while (referenceParts.length && comparerParts.length) {
|
862
|
+
var referencePart = referenceParts.shift();
|
863
|
+
var comparerPart = comparerParts.shift();
|
864
|
+
var comparisonResult = referencePart[0] - comparerPart[0] ||
|
865
|
+
referencePart[1].localeCompare(comparerPart[1]);
|
866
|
+
if (comparisonResult)
|
867
|
+
return comparisonResult;
|
868
|
+
}
|
869
|
+
return referenceParts.length - comparerParts.length;
|
870
|
+
}
|
838
871
|
/**
|
839
872
|
* Utility file for common actions
|
840
873
|
*
|
@@ -3033,21 +3066,77 @@ function Download(parent, path, items) {
|
|
3033
3066
|
var downloadUrl = parent.ajaxSettings.downloadUrl ? parent.ajaxSettings.downloadUrl : parent.ajaxSettings.url;
|
3034
3067
|
// eslint-disable-next-line
|
3035
3068
|
var data = { 'action': 'download', 'path': path, 'names': items, 'data': parent.itemData };
|
3036
|
-
var
|
3069
|
+
var ajaxSettings = {
|
3070
|
+
url: downloadUrl,
|
3071
|
+
type: 'POST',
|
3072
|
+
contentType: 'application/json',
|
3073
|
+
responseType: 'blob',
|
3074
|
+
data: JSON.stringify(data),
|
3075
|
+
onSuccess: null,
|
3076
|
+
onFailure: null,
|
3077
|
+
beforeSend: null
|
3078
|
+
};
|
3079
|
+
var eventArgs = { data: data, cancel: false, useFormPost: true, ajaxSettings: ajaxSettings };
|
3037
3080
|
parent.trigger('beforeDownload', eventArgs, function (downloadArgs) {
|
3038
3081
|
if (!downloadArgs.cancel) {
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3042
|
-
|
3043
|
-
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3082
|
+
if (downloadArgs.useFormPost) {
|
3083
|
+
var form = createElement('form', {
|
3084
|
+
id: parent.element.id + '_downloadForm',
|
3085
|
+
attrs: { action: downloadUrl, method: 'post', name: 'downloadForm', 'download': '' }
|
3086
|
+
});
|
3087
|
+
var input = createElement('input', {
|
3088
|
+
id: parent.element.id + '_hiddenForm',
|
3089
|
+
attrs: { name: 'downloadInput', value: JSON.stringify(downloadArgs.data), type: 'hidden' }
|
3090
|
+
});
|
3091
|
+
form.appendChild(input);
|
3092
|
+
parent.element.appendChild(form);
|
3093
|
+
document.forms.namedItem('downloadForm').submit();
|
3094
|
+
parent.element.removeChild(form);
|
3095
|
+
}
|
3096
|
+
else {
|
3097
|
+
var contentDisposition_1;
|
3098
|
+
var fileName_1;
|
3099
|
+
var fetch_1 = new Fetch({
|
3100
|
+
url: getValue('url', downloadArgs.ajaxSettings),
|
3101
|
+
type: getValue('type', downloadArgs.ajaxSettings),
|
3102
|
+
contentType: getValue('contentType', downloadArgs.ajaxSettings),
|
3103
|
+
responseType: getValue('responseType', downloadArgs.ajaxSettings),
|
3104
|
+
beforeSend: getValue('beforeSend', downloadArgs.ajaxSettings),
|
3105
|
+
onLoad: function (e) {
|
3106
|
+
contentDisposition_1 = e.headers.get('Content-Disposition');
|
3107
|
+
if (contentDisposition_1) {
|
3108
|
+
var filenameMatch = contentDisposition_1.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
3109
|
+
var extractedFilename = filenameMatch && filenameMatch[1];
|
3110
|
+
fileName_1 = extractedFilename ? extractedFilename.replace(/['"]/g, '') : fileName_1;
|
3111
|
+
}
|
3112
|
+
else {
|
3113
|
+
fileName_1 = parent.itemData.length > 1 ? 'files.zip' : getValue('isFile', parent.itemData[0]) ? getValue('name', parent.itemData[0]) : getValue('name', parent.itemData[0]) + '.zip';
|
3114
|
+
}
|
3115
|
+
},
|
3116
|
+
onSuccess: function (e) {
|
3117
|
+
parent.trigger('success', downloadArgs);
|
3118
|
+
var blob = e;
|
3119
|
+
var blobUrl = URL.createObjectURL(blob);
|
3120
|
+
var link = document.createElement('a');
|
3121
|
+
link.href = blobUrl;
|
3122
|
+
link.download = fileName_1;
|
3123
|
+
document.body.appendChild(link);
|
3124
|
+
link.click();
|
3125
|
+
document.body.removeChild(link);
|
3126
|
+
},
|
3127
|
+
onFailure: function (e) {
|
3128
|
+
var result = {
|
3129
|
+
error: {
|
3130
|
+
code: e.status.toString(),
|
3131
|
+
message: getLocaleText(parent, 'Network-Error') + ' ' + parent.ajaxSettings.downloadUrl,
|
3132
|
+
},
|
3133
|
+
};
|
3134
|
+
createDialog(parent, 'Error', result);
|
3135
|
+
parent.trigger('failure', downloadArgs);
|
3136
|
+
},
|
3137
|
+
});
|
3138
|
+
fetch_1.send(JSON.stringify(downloadArgs.data));
|
3139
|
+
}
|
3051
3140
|
}
|
3052
3141
|
});
|
3053
3142
|
}
|
@@ -4139,7 +4228,12 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4139
4228
|
};
|
4140
4229
|
this.items = [];
|
4141
4230
|
this.items = this.renderList(args);
|
4142
|
-
|
4231
|
+
if (this.parent.sortComparer && this.parent.sortBy !== 'None') {
|
4232
|
+
this.items = this.allItems = DataUtil.sort(this.items, this.parent.sortBy, this.comparer.bind(this));
|
4233
|
+
}
|
4234
|
+
else {
|
4235
|
+
this.items = this.allItems = getSortedData(this.parent, this.items);
|
4236
|
+
}
|
4143
4237
|
iconsView.classList.remove(DISPLAY_NONE);
|
4144
4238
|
if (this.parent.enableVirtualization && this.allItems.length > 0) {
|
4145
4239
|
if (!this.element.style.height) {
|
@@ -4199,6 +4293,15 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4199
4293
|
}
|
4200
4294
|
}
|
4201
4295
|
};
|
4296
|
+
LargeIconsView.prototype.comparer = function (x, y, xObj, yObj) {
|
4297
|
+
if (this.parent.sortOrder === 'Descending') {
|
4298
|
+
var z = x;
|
4299
|
+
x = y;
|
4300
|
+
y = z;
|
4301
|
+
}
|
4302
|
+
return this.parent.sortComparer(x, y);
|
4303
|
+
};
|
4304
|
+
|
4202
4305
|
LargeIconsView.prototype.preventImgDrag = function () {
|
4203
4306
|
var i = 0;
|
4204
4307
|
while (i < this.itemList.length) {
|
@@ -6938,31 +7041,36 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6938
7041
|
if (this.toolbarSettings.visible) {
|
6939
7042
|
modules.push({
|
6940
7043
|
member: 'toolbar',
|
6941
|
-
args: [this]
|
7044
|
+
args: [this],
|
7045
|
+
name: 'Toolbar'
|
6942
7046
|
});
|
6943
7047
|
}
|
6944
7048
|
if (this.navigationPaneSettings.visible) {
|
6945
7049
|
modules.push({
|
6946
7050
|
member: 'navigationpane',
|
6947
|
-
args: [this]
|
7051
|
+
args: [this],
|
7052
|
+
name: 'NavigationPane'
|
6948
7053
|
});
|
6949
7054
|
}
|
6950
7055
|
if (this.view) {
|
6951
7056
|
modules.push({
|
6952
7057
|
member: 'detailsview',
|
6953
|
-
args: [this]
|
7058
|
+
args: [this],
|
7059
|
+
name: 'DetailsView'
|
6954
7060
|
});
|
6955
7061
|
}
|
6956
7062
|
if (this.contextMenuSettings.visible && !this.isDevice) {
|
6957
7063
|
modules.push({
|
6958
7064
|
member: 'contextmenu',
|
6959
|
-
args: [this]
|
7065
|
+
args: [this],
|
7066
|
+
name: 'ContextMenu'
|
6960
7067
|
});
|
6961
7068
|
}
|
6962
7069
|
if (this.enableVirtualization) {
|
6963
7070
|
modules.push({
|
6964
7071
|
member: 'virtualization',
|
6965
|
-
args: [this]
|
7072
|
+
args: [this],
|
7073
|
+
name: 'Virtualization'
|
6966
7074
|
});
|
6967
7075
|
}
|
6968
7076
|
return modules;
|
@@ -7975,6 +8083,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7975
8083
|
__decorate$8([
|
7976
8084
|
Property('name')
|
7977
8085
|
], FileManager.prototype, "sortBy", void 0);
|
8086
|
+
__decorate$8([
|
8087
|
+
Property(null)
|
8088
|
+
], FileManager.prototype, "sortComparer", void 0);
|
7978
8089
|
__decorate$8([
|
7979
8090
|
Complex({}, ToolbarSettings)
|
7980
8091
|
], FileManager.prototype, "toolbarSettings", void 0);
|
@@ -8227,6 +8338,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8227
8338
|
});
|
8228
8339
|
};
|
8229
8340
|
Toolbar$$1.prototype.toolbarCreateHandler = function () {
|
8341
|
+
var _this = this;
|
8230
8342
|
if (!isNullOrUndefined(select('#' + this.getId('SortBy'), this.parent.element))) {
|
8231
8343
|
var items = [
|
8232
8344
|
{ id: this.getPupupId('name'), text: getLocaleText(this.parent, 'Name'),
|
@@ -8253,15 +8365,15 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8253
8365
|
this.buttonObj.appendTo('#' + this.getId('SortBy'));
|
8254
8366
|
}
|
8255
8367
|
if (!isNullOrUndefined(select('#' + this.getId('View'), this.parent.element))) {
|
8256
|
-
var
|
8257
|
-
var
|
8368
|
+
var gridSpan_1 = '<span class="' + ICON_GRID + ' ' + MENU_ICON + '"></span>';
|
8369
|
+
var largeIconSpan_1 = '<span class="' + ICON_LARGE + ' ' + MENU_ICON + '"></span>';
|
8258
8370
|
var layoutItems = [
|
8259
8371
|
{
|
8260
|
-
id: this.getPupupId('large'), text:
|
8372
|
+
id: this.getPupupId('large'), text: getLocaleText(this.parent, 'View-LargeIcons'),
|
8261
8373
|
iconCss: this.parent.view === 'Details' ? '' : TB_OPTION_TICK
|
8262
8374
|
},
|
8263
8375
|
{
|
8264
|
-
id: this.getPupupId('details'), text:
|
8376
|
+
id: this.getPupupId('details'), text: getLocaleText(this.parent, 'View-Details'),
|
8265
8377
|
iconCss: this.parent.view === 'Details' ? TB_OPTION_TICK : ''
|
8266
8378
|
}
|
8267
8379
|
];
|
@@ -8270,7 +8382,17 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8270
8382
|
cssClass: getCssClass(this.parent, 'e-caret-hide ' + ROOT_POPUP),
|
8271
8383
|
items: layoutItems, select: this.layoutChange.bind(this),
|
8272
8384
|
enableRtl: this.parent.enableRtl,
|
8273
|
-
content: '<span class="e-tbar-btn-text">' + getLocaleText(this.parent, 'View') + '</span>'
|
8385
|
+
content: '<span class="e-tbar-btn-text">' + getLocaleText(this.parent, 'View') + '</span>',
|
8386
|
+
beforeItemRender: function (args) {
|
8387
|
+
var tickIcon = args.item.iconCss;
|
8388
|
+
var viewText = args.item.text === getLocaleText(_this.parent, 'View-LargeIcons');
|
8389
|
+
var iconClass = tickIcon ? ' e-menu-icon ' + tickIcon : '';
|
8390
|
+
args.element.innerHTML = '<span class="' + iconClass + '"></span>' + (viewText ? largeIconSpan_1 : gridSpan_1) + args.item.text;
|
8391
|
+
var span = args.element.firstChild;
|
8392
|
+
if (span && span.className === '') {
|
8393
|
+
args.element.removeChild(span);
|
8394
|
+
}
|
8395
|
+
}
|
8274
8396
|
});
|
8275
8397
|
this.layoutBtnObj.isStringTemplate = true;
|
8276
8398
|
this.layoutBtnObj.appendTo('#' + this.getId('View'));
|
@@ -9180,7 +9302,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9180
9302
|
this.parent.selectedItems = [];
|
9181
9303
|
this.parent.itemData = nodeData;
|
9182
9304
|
var previousPath = this.parent.path;
|
9183
|
-
var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
|
9184
9305
|
if (!this.isRightClick && this.isSameNodeClicked) {
|
9185
9306
|
updatePath(args.node, this.parent.itemData[0], this.parent);
|
9186
9307
|
}
|
@@ -9839,9 +9960,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
9839
9960
|
this.isNameWidth = false;
|
9840
9961
|
this.pasteOperation = false;
|
9841
9962
|
this.uploadOperation = false;
|
9842
|
-
/* istanbul ignore next */
|
9843
|
-
// eslint:disable-next-line
|
9844
|
-
this.actionDivert = false;
|
9845
9963
|
Grid.Inject(Resize, ContextMenu$1, Sort, VirtualScroll);
|
9846
9964
|
this.parent = parent;
|
9847
9965
|
this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
|
@@ -10002,12 +10120,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10002
10120
|
};
|
10003
10121
|
DetailsView.prototype.getColumns = function () {
|
10004
10122
|
var columns;
|
10123
|
+
var enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
|
10005
10124
|
if (this.parent.isMobile) {
|
10006
10125
|
columns = [
|
10007
10126
|
{
|
10008
10127
|
field: 'name', headerText: getLocaleText(this.parent, 'Name'), width: 'auto', minWidth: 120, headerTextAlign: 'Left',
|
10009
10128
|
template: initializeCSPTemplate(function (data) {
|
10010
|
-
|
10129
|
+
var name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
10130
|
+
return "<div class=\"e-fe-text\">" + name + "</div><div class=\"e-fe-date\">" + data._fm_modified + "</div>' +\n '<span class=\"e-fe-size\">" + data.size + "</span>";
|
10011
10131
|
})
|
10012
10132
|
}
|
10013
10133
|
];
|
@@ -10015,8 +10135,19 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10015
10135
|
else {
|
10016
10136
|
columns = extend([], this.parent.detailsViewSettings.columns, null, true);
|
10017
10137
|
this.adjustWidth(columns, 'name');
|
10138
|
+
var _loop_1 = function (i, len) {
|
10139
|
+
columns[i].headerText = getLocaleText(this_1.parent, columns[i].headerText);
|
10140
|
+
if (columns[i].field === 'name' && !isNullOrUndefined(columns[i].template) && !(typeof columns[i].template === 'function')) {
|
10141
|
+
var template_1 = columns[i].template;
|
10142
|
+
columns[i].template = initializeCSPTemplate(function (data) {
|
10143
|
+
var name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
10144
|
+
return template_1.replace(/\${name}/g, name);
|
10145
|
+
});
|
10146
|
+
}
|
10147
|
+
};
|
10148
|
+
var this_1 = this;
|
10018
10149
|
for (var i = 0, len = columns.length; i < len; i++) {
|
10019
|
-
|
10150
|
+
_loop_1(i, len);
|
10020
10151
|
}
|
10021
10152
|
}
|
10022
10153
|
var iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '54' : '46');
|
@@ -10171,10 +10302,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10171
10302
|
}
|
10172
10303
|
};
|
10173
10304
|
DetailsView.prototype.onBeforeDataBound = function (args) {
|
10305
|
+
var _this = this;
|
10174
10306
|
showSpinner(this.parent.element);
|
10175
|
-
|
10176
|
-
|
10177
|
-
|
10307
|
+
var nameColumn = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === _this.parent.sortBy; });
|
10308
|
+
if (nameColumn && !('sortComparer' in nameColumn)) {
|
10309
|
+
// eslint-disable-next-line
|
10310
|
+
var items = getSortedData(this.parent, (this.parent.enableVirtualization) ? args.result : this.gridObj.dataSource);
|
10311
|
+
args.result = items;
|
10312
|
+
}
|
10178
10313
|
};
|
10179
10314
|
/* istanbul ignore next */
|
10180
10315
|
DetailsView.prototype.onDataBound = function () {
|
@@ -11053,12 +11188,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11053
11188
|
eventName: 'keydown'
|
11054
11189
|
});
|
11055
11190
|
EventHandler.add(this.gridObj.element, 'blur', this.removeFocus, this);
|
11191
|
+
EventHandler.add(this.parent.element, 'focusout', this.onBlur, this);
|
11056
11192
|
};
|
11057
11193
|
DetailsView.prototype.unWireEvents = function () {
|
11058
11194
|
this.wireClickEvent(false);
|
11059
11195
|
this.keyboardModule.destroy();
|
11060
11196
|
this.keyboardDownModule.destroy();
|
11061
11197
|
EventHandler.remove(this.gridObj.element, 'blur', this.removeFocus);
|
11198
|
+
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
11062
11199
|
};
|
11063
11200
|
DetailsView.prototype.wireClickEvent = function (toBind) {
|
11064
11201
|
if (toBind) {
|
@@ -11108,6 +11245,19 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11108
11245
|
DetailsView.prototype.removeFocus = function () {
|
11109
11246
|
this.addFocus(null);
|
11110
11247
|
};
|
11248
|
+
DetailsView.prototype.onBlur = function (e) {
|
11249
|
+
if ((e.relatedTarget !== null && closest(e.relatedTarget, '.e-grid') !== e.relatedTarget)) {
|
11250
|
+
return;
|
11251
|
+
}
|
11252
|
+
if (!isNullOrUndefined(this.gridObj.element)) {
|
11253
|
+
var thElements = this.gridObj.element.querySelectorAll('th');
|
11254
|
+
for (var i = 0; i < thElements.length; i++) {
|
11255
|
+
if (thElements[i].classList.contains('e-focus')) {
|
11256
|
+
this.addFocus(null);
|
11257
|
+
}
|
11258
|
+
}
|
11259
|
+
}
|
11260
|
+
};
|
11111
11261
|
DetailsView.prototype.getFocusedItemIndex = function () {
|
11112
11262
|
return (!isNullOrUndefined(this.getFocusedItem())) ?
|
11113
11263
|
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
@@ -11156,6 +11306,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11156
11306
|
break;
|
11157
11307
|
}
|
11158
11308
|
};
|
11309
|
+
/* istanbul ignore next */
|
11310
|
+
// eslint:disable-next-line
|
11159
11311
|
DetailsView.prototype.keyupHandler = function (e) {
|
11160
11312
|
if (!this.isRendered) {
|
11161
11313
|
return;
|
@@ -11186,7 +11338,15 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11186
11338
|
this.performDelete();
|
11187
11339
|
break;
|
11188
11340
|
case 'enter':
|
11189
|
-
if (this.gridObj.selectedRowIndex === -1) {
|
11341
|
+
if (this.gridObj.selectedRowIndex === -1 && this.gridObj.allowSorting === true) {
|
11342
|
+
if (!e.target.classList.contains('e-fe-grid-icon')) {
|
11343
|
+
var direction = !e.target.getElementsByClassName('e-ascending').length ? 'Ascending' : 'Descending';
|
11344
|
+
var currentField = this.gridObj.getColumnByUid(e.target.querySelector('.e-headercelldiv').getAttribute('e-mappinguid')).field;
|
11345
|
+
this.gridObj.sortColumn(currentField, direction);
|
11346
|
+
if (!isNullOrUndefined(this.getFocusedItem().nextSibling)) {
|
11347
|
+
this.getFocusedItem().nextSibling.setAttribute('tabindex', '0');
|
11348
|
+
}
|
11349
|
+
}
|
11190
11350
|
break;
|
11191
11351
|
}
|
11192
11352
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
@@ -11233,13 +11393,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11233
11393
|
else if (this.gridObj.selectedRowIndex !== -1 && e.action === 'tab') {
|
11234
11394
|
return;
|
11235
11395
|
}
|
11236
|
-
else if (!this.actionDivert) {
|
11237
|
-
this.addHeaderFocus();
|
11238
|
-
this.actionDivert = true;
|
11239
|
-
}
|
11240
11396
|
else {
|
11241
|
-
this.
|
11242
|
-
this.actionDivert = false;
|
11397
|
+
this.addHeaderFocus(e);
|
11243
11398
|
}
|
11244
11399
|
}
|
11245
11400
|
break;
|
@@ -11526,16 +11681,29 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11526
11681
|
addClass([itemElement], [FOCUS, FOCUSED]);
|
11527
11682
|
}
|
11528
11683
|
};
|
11529
|
-
DetailsView.prototype.addHeaderFocus = function () {
|
11684
|
+
DetailsView.prototype.addHeaderFocus = function (e) {
|
11530
11685
|
var treeFocus = select('.e-row', this.element);
|
11531
11686
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
11532
|
-
var nameFocus
|
11533
|
-
|
11534
|
-
|
11535
|
-
|
11536
|
-
|
11537
|
-
if (
|
11538
|
-
|
11687
|
+
var nameFocus;
|
11688
|
+
if (!isNullOrUndefined(e.target) && e.target.classList.contains('e-defaultcursor')) {
|
11689
|
+
this.addFocus(0);
|
11690
|
+
nameFocus = e.target.nextElementSibling;
|
11691
|
+
}
|
11692
|
+
else if (!isNullOrUndefined(this.gridObj.element.querySelector('.e-focus')) && (this.gridObj.element.querySelector('.e-focus').tagName === 'TH')) {
|
11693
|
+
nameFocus = this.gridObj.element.querySelector('.e-focus').nextElementSibling;
|
11694
|
+
this.addFocus(0);
|
11695
|
+
}
|
11696
|
+
else {
|
11697
|
+
nameFocus = select('th.e-fe-grid-icon', this.element);
|
11698
|
+
}
|
11699
|
+
if (!isNullOrUndefined(nameFocus)) {
|
11700
|
+
nameFocus.setAttribute('tabindex', '0');
|
11701
|
+
nameFocus.focus();
|
11702
|
+
addClass([nameFocus], [FOCUS, FOCUSED]);
|
11703
|
+
treeFocus.setAttribute('tabindex', '0');
|
11704
|
+
if (treeFocus.tabIndex === 0 && nameFocus.tabIndex === 0) {
|
11705
|
+
removeClass([treeFocus], [FOCUS, FOCUSED]);
|
11706
|
+
}
|
11539
11707
|
}
|
11540
11708
|
};
|
11541
11709
|
DetailsView.prototype.getFocusedItem = function () {
|
@@ -11749,5 +11917,5 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11749
11917
|
* File Manager all modules
|
11750
11918
|
*/
|
11751
11919
|
|
11752
|
-
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 };
|
11920
|
+
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 };
|
11753
11921
|
//# sourceMappingURL=ej2-filemanager.es5.js.map
|