@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';
|
@@ -145,9 +145,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
145
145
|
const columnArray = [
|
146
146
|
{
|
147
147
|
field: 'name', headerText: 'Name', minWidth: 120, isPrimaryKey: true,
|
148
|
-
template:
|
149
|
-
return `<span class="e-fe-text">${data.name}</span>`;
|
150
|
-
}),
|
148
|
+
template: '<span class=\"e-fe-text\">${name}</span>',
|
151
149
|
customAttributes: { class: 'e-fe-grid-name' }
|
152
150
|
},
|
153
151
|
{
|
@@ -298,6 +296,9 @@ __decorate$7([
|
|
298
296
|
__decorate$7([
|
299
297
|
Property(null)
|
300
298
|
], Column.prototype, "template", void 0);
|
299
|
+
__decorate$7([
|
300
|
+
Property(null)
|
301
|
+
], Column.prototype, "sortComparer", void 0);
|
301
302
|
__decorate$7([
|
302
303
|
Property(null)
|
303
304
|
], Column.prototype, "headerTemplate", void 0);
|
@@ -686,6 +687,38 @@ const permissionUpload = 'upload';
|
|
686
687
|
/** @hidden */
|
687
688
|
const permissionDownload = 'download';
|
688
689
|
|
690
|
+
/**
|
691
|
+
* Utility function to compare two strings in a way similar to Windows Explorer.
|
692
|
+
* Files and folders are sorted separately, with folders coming before files.
|
693
|
+
*
|
694
|
+
* @param {string} reference - The first string to compare. This could be a file or folder name.
|
695
|
+
* @param {string} comparer - The second string to compare. This could be a file or folder name.
|
696
|
+
* @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.
|
697
|
+
*/
|
698
|
+
function sortComparer(reference, comparer) {
|
699
|
+
// Check if reference and comparer are files or folders
|
700
|
+
let referenceIsFile = /\.\S+/.test(reference);
|
701
|
+
let comparerIsFile = /\.\S+/.test(comparer);
|
702
|
+
// If one is a file and the other is a folder, the folder should come first
|
703
|
+
if (referenceIsFile && !comparerIsFile)
|
704
|
+
return 1;
|
705
|
+
if (!referenceIsFile && comparerIsFile)
|
706
|
+
return -1;
|
707
|
+
let referenceParts = [];
|
708
|
+
let comparerParts = [];
|
709
|
+
(reference + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { referenceParts.push([$1 || Infinity, $2 || ""]); return ""; });
|
710
|
+
(comparer + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { comparerParts.push([$1 || Infinity, $2 || ""]); return ""; });
|
711
|
+
// Compare each part of reference and comparer
|
712
|
+
while (referenceParts.length && comparerParts.length) {
|
713
|
+
let referencePart = referenceParts.shift();
|
714
|
+
let comparerPart = comparerParts.shift();
|
715
|
+
let comparisonResult = referencePart[0] - comparerPart[0] ||
|
716
|
+
referencePart[1].localeCompare(comparerPart[1]);
|
717
|
+
if (comparisonResult)
|
718
|
+
return comparisonResult;
|
719
|
+
}
|
720
|
+
return referenceParts.length - comparerParts.length;
|
721
|
+
}
|
689
722
|
/**
|
690
723
|
* Utility file for common actions
|
691
724
|
*
|
@@ -2884,21 +2917,77 @@ function Download(parent, path, items) {
|
|
2884
2917
|
const downloadUrl = parent.ajaxSettings.downloadUrl ? parent.ajaxSettings.downloadUrl : parent.ajaxSettings.url;
|
2885
2918
|
// eslint-disable-next-line
|
2886
2919
|
const data = { 'action': 'download', 'path': path, 'names': items, 'data': parent.itemData };
|
2887
|
-
const
|
2920
|
+
const ajaxSettings = {
|
2921
|
+
url: downloadUrl,
|
2922
|
+
type: 'POST',
|
2923
|
+
contentType: 'application/json',
|
2924
|
+
responseType: 'blob',
|
2925
|
+
data: JSON.stringify(data),
|
2926
|
+
onSuccess: null,
|
2927
|
+
onFailure: null,
|
2928
|
+
beforeSend: null
|
2929
|
+
};
|
2930
|
+
const eventArgs = { data: data, cancel: false, useFormPost: true, ajaxSettings: ajaxSettings };
|
2888
2931
|
parent.trigger('beforeDownload', eventArgs, (downloadArgs) => {
|
2889
2932
|
if (!downloadArgs.cancel) {
|
2890
|
-
|
2891
|
-
|
2892
|
-
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2897
|
-
|
2898
|
-
|
2899
|
-
|
2900
|
-
|
2901
|
-
|
2933
|
+
if (downloadArgs.useFormPost) {
|
2934
|
+
const form = createElement('form', {
|
2935
|
+
id: parent.element.id + '_downloadForm',
|
2936
|
+
attrs: { action: downloadUrl, method: 'post', name: 'downloadForm', 'download': '' }
|
2937
|
+
});
|
2938
|
+
const input = createElement('input', {
|
2939
|
+
id: parent.element.id + '_hiddenForm',
|
2940
|
+
attrs: { name: 'downloadInput', value: JSON.stringify(downloadArgs.data), type: 'hidden' }
|
2941
|
+
});
|
2942
|
+
form.appendChild(input);
|
2943
|
+
parent.element.appendChild(form);
|
2944
|
+
document.forms.namedItem('downloadForm').submit();
|
2945
|
+
parent.element.removeChild(form);
|
2946
|
+
}
|
2947
|
+
else {
|
2948
|
+
let contentDisposition;
|
2949
|
+
let fileName;
|
2950
|
+
const fetch = new Fetch({
|
2951
|
+
url: getValue('url', downloadArgs.ajaxSettings),
|
2952
|
+
type: getValue('type', downloadArgs.ajaxSettings),
|
2953
|
+
contentType: getValue('contentType', downloadArgs.ajaxSettings),
|
2954
|
+
responseType: getValue('responseType', downloadArgs.ajaxSettings),
|
2955
|
+
beforeSend: getValue('beforeSend', downloadArgs.ajaxSettings),
|
2956
|
+
onLoad: (e) => {
|
2957
|
+
contentDisposition = e.headers.get('Content-Disposition');
|
2958
|
+
if (contentDisposition) {
|
2959
|
+
const filenameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
2960
|
+
const extractedFilename = filenameMatch && filenameMatch[1];
|
2961
|
+
fileName = extractedFilename ? extractedFilename.replace(/['"]/g, '') : fileName;
|
2962
|
+
}
|
2963
|
+
else {
|
2964
|
+
fileName = parent.itemData.length > 1 ? 'files.zip' : getValue('isFile', parent.itemData[0]) ? getValue('name', parent.itemData[0]) : getValue('name', parent.itemData[0]) + '.zip';
|
2965
|
+
}
|
2966
|
+
},
|
2967
|
+
onSuccess: (e) => {
|
2968
|
+
parent.trigger('success', downloadArgs);
|
2969
|
+
const blob = e;
|
2970
|
+
const blobUrl = URL.createObjectURL(blob);
|
2971
|
+
const link = document.createElement('a');
|
2972
|
+
link.href = blobUrl;
|
2973
|
+
link.download = fileName;
|
2974
|
+
document.body.appendChild(link);
|
2975
|
+
link.click();
|
2976
|
+
document.body.removeChild(link);
|
2977
|
+
},
|
2978
|
+
onFailure: (e) => {
|
2979
|
+
const result = {
|
2980
|
+
error: {
|
2981
|
+
code: e.status.toString(),
|
2982
|
+
message: getLocaleText(parent, 'Network-Error') + ' ' + parent.ajaxSettings.downloadUrl,
|
2983
|
+
},
|
2984
|
+
};
|
2985
|
+
createDialog(parent, 'Error', result);
|
2986
|
+
parent.trigger('failure', downloadArgs);
|
2987
|
+
},
|
2988
|
+
});
|
2989
|
+
fetch.send(JSON.stringify(downloadArgs.data));
|
2990
|
+
}
|
2902
2991
|
}
|
2903
2992
|
});
|
2904
2993
|
}
|
@@ -3987,7 +4076,12 @@ class LargeIconsView {
|
|
3987
4076
|
};
|
3988
4077
|
this.items = [];
|
3989
4078
|
this.items = this.renderList(args);
|
3990
|
-
|
4079
|
+
if (this.parent.sortComparer && this.parent.sortBy !== 'None') {
|
4080
|
+
this.items = this.allItems = DataUtil.sort(this.items, this.parent.sortBy, this.comparer.bind(this));
|
4081
|
+
}
|
4082
|
+
else {
|
4083
|
+
this.items = this.allItems = getSortedData(this.parent, this.items);
|
4084
|
+
}
|
3991
4085
|
iconsView.classList.remove(DISPLAY_NONE);
|
3992
4086
|
if (this.parent.enableVirtualization && this.allItems.length > 0) {
|
3993
4087
|
if (!this.element.style.height) {
|
@@ -4047,6 +4141,15 @@ class LargeIconsView {
|
|
4047
4141
|
}
|
4048
4142
|
}
|
4049
4143
|
}
|
4144
|
+
comparer(x, y, xObj, yObj) {
|
4145
|
+
if (this.parent.sortOrder === 'Descending') {
|
4146
|
+
const z = x;
|
4147
|
+
x = y;
|
4148
|
+
y = z;
|
4149
|
+
}
|
4150
|
+
return this.parent.sortComparer(x, y);
|
4151
|
+
}
|
4152
|
+
;
|
4050
4153
|
preventImgDrag() {
|
4051
4154
|
let i = 0;
|
4052
4155
|
while (i < this.itemList.length) {
|
@@ -6758,31 +6861,36 @@ let FileManager = FileManager_1 = class FileManager extends Component {
|
|
6758
6861
|
if (this.toolbarSettings.visible) {
|
6759
6862
|
modules.push({
|
6760
6863
|
member: 'toolbar',
|
6761
|
-
args: [this]
|
6864
|
+
args: [this],
|
6865
|
+
name: 'Toolbar'
|
6762
6866
|
});
|
6763
6867
|
}
|
6764
6868
|
if (this.navigationPaneSettings.visible) {
|
6765
6869
|
modules.push({
|
6766
6870
|
member: 'navigationpane',
|
6767
|
-
args: [this]
|
6871
|
+
args: [this],
|
6872
|
+
name: 'NavigationPane'
|
6768
6873
|
});
|
6769
6874
|
}
|
6770
6875
|
if (this.view) {
|
6771
6876
|
modules.push({
|
6772
6877
|
member: 'detailsview',
|
6773
|
-
args: [this]
|
6878
|
+
args: [this],
|
6879
|
+
name: 'DetailsView'
|
6774
6880
|
});
|
6775
6881
|
}
|
6776
6882
|
if (this.contextMenuSettings.visible && !this.isDevice) {
|
6777
6883
|
modules.push({
|
6778
6884
|
member: 'contextmenu',
|
6779
|
-
args: [this]
|
6885
|
+
args: [this],
|
6886
|
+
name: 'ContextMenu'
|
6780
6887
|
});
|
6781
6888
|
}
|
6782
6889
|
if (this.enableVirtualization) {
|
6783
6890
|
modules.push({
|
6784
6891
|
member: 'virtualization',
|
6785
|
-
args: [this]
|
6892
|
+
args: [this],
|
6893
|
+
name: 'Virtualization'
|
6786
6894
|
});
|
6787
6895
|
}
|
6788
6896
|
return modules;
|
@@ -7794,6 +7902,9 @@ __decorate$8([
|
|
7794
7902
|
__decorate$8([
|
7795
7903
|
Property('name')
|
7796
7904
|
], FileManager.prototype, "sortBy", void 0);
|
7905
|
+
__decorate$8([
|
7906
|
+
Property(null)
|
7907
|
+
], FileManager.prototype, "sortComparer", void 0);
|
7797
7908
|
__decorate$8([
|
7798
7909
|
Complex({}, ToolbarSettings)
|
7799
7910
|
], FileManager.prototype, "toolbarSettings", void 0);
|
@@ -8061,11 +8172,11 @@ class Toolbar$1 {
|
|
8061
8172
|
const largeIconSpan = '<span class="' + ICON_LARGE + ' ' + MENU_ICON + '"></span>';
|
8062
8173
|
const layoutItems = [
|
8063
8174
|
{
|
8064
|
-
id: this.getPupupId('large'), text:
|
8175
|
+
id: this.getPupupId('large'), text: getLocaleText(this.parent, 'View-LargeIcons'),
|
8065
8176
|
iconCss: this.parent.view === 'Details' ? '' : TB_OPTION_TICK
|
8066
8177
|
},
|
8067
8178
|
{
|
8068
|
-
id: this.getPupupId('details'), text:
|
8179
|
+
id: this.getPupupId('details'), text: getLocaleText(this.parent, 'View-Details'),
|
8069
8180
|
iconCss: this.parent.view === 'Details' ? TB_OPTION_TICK : ''
|
8070
8181
|
}
|
8071
8182
|
];
|
@@ -8074,7 +8185,17 @@ class Toolbar$1 {
|
|
8074
8185
|
cssClass: getCssClass(this.parent, 'e-caret-hide ' + ROOT_POPUP),
|
8075
8186
|
items: layoutItems, select: this.layoutChange.bind(this),
|
8076
8187
|
enableRtl: this.parent.enableRtl,
|
8077
|
-
content: '<span class="e-tbar-btn-text">' + getLocaleText(this.parent, 'View') + '</span>'
|
8188
|
+
content: '<span class="e-tbar-btn-text">' + getLocaleText(this.parent, 'View') + '</span>',
|
8189
|
+
beforeItemRender: (args) => {
|
8190
|
+
const tickIcon = args.item.iconCss;
|
8191
|
+
const viewText = args.item.text === getLocaleText(this.parent, 'View-LargeIcons');
|
8192
|
+
const iconClass = tickIcon ? ' e-menu-icon ' + tickIcon : '';
|
8193
|
+
args.element.innerHTML = '<span class="' + iconClass + '"></span>' + (viewText ? largeIconSpan : gridSpan) + args.item.text;
|
8194
|
+
const span = args.element.firstChild;
|
8195
|
+
if (span && span.className === '') {
|
8196
|
+
args.element.removeChild(span);
|
8197
|
+
}
|
8198
|
+
}
|
8078
8199
|
});
|
8079
8200
|
this.layoutBtnObj.isStringTemplate = true;
|
8080
8201
|
this.layoutBtnObj.appendTo('#' + this.getId('View'));
|
@@ -8974,7 +9095,6 @@ class NavigationPane {
|
|
8974
9095
|
this.parent.selectedItems = [];
|
8975
9096
|
this.parent.itemData = nodeData;
|
8976
9097
|
const previousPath = this.parent.path;
|
8977
|
-
const sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
|
8978
9098
|
if (!this.isRightClick && this.isSameNodeClicked) {
|
8979
9099
|
updatePath(args.node, this.parent.itemData[0], this.parent);
|
8980
9100
|
}
|
@@ -9631,9 +9751,6 @@ class DetailsView {
|
|
9631
9751
|
this.isNameWidth = false;
|
9632
9752
|
this.pasteOperation = false;
|
9633
9753
|
this.uploadOperation = false;
|
9634
|
-
/* istanbul ignore next */
|
9635
|
-
// eslint:disable-next-line
|
9636
|
-
this.actionDivert = false;
|
9637
9754
|
Grid.Inject(Resize, ContextMenu$1, Sort, VirtualScroll);
|
9638
9755
|
this.parent = parent;
|
9639
9756
|
this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
|
@@ -9794,12 +9911,14 @@ class DetailsView {
|
|
9794
9911
|
}
|
9795
9912
|
getColumns() {
|
9796
9913
|
let columns;
|
9914
|
+
let enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
|
9797
9915
|
if (this.parent.isMobile) {
|
9798
9916
|
columns = [
|
9799
9917
|
{
|
9800
9918
|
field: 'name', headerText: getLocaleText(this.parent, 'Name'), width: 'auto', minWidth: 120, headerTextAlign: 'Left',
|
9801
9919
|
template: initializeCSPTemplate(function (data) {
|
9802
|
-
|
9920
|
+
const name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
9921
|
+
return `<div class="e-fe-text">${name}</div><div class="e-fe-date">${data._fm_modified}</div>' +
|
9803
9922
|
'<span class="e-fe-size">${data.size}</span>`;
|
9804
9923
|
})
|
9805
9924
|
}
|
@@ -9810,6 +9929,13 @@ class DetailsView {
|
|
9810
9929
|
this.adjustWidth(columns, 'name');
|
9811
9930
|
for (let i = 0, len = columns.length; i < len; i++) {
|
9812
9931
|
columns[i].headerText = getLocaleText(this.parent, columns[i].headerText);
|
9932
|
+
if (columns[i].field === 'name' && !isNullOrUndefined(columns[i].template) && !(typeof columns[i].template === 'function')) {
|
9933
|
+
const template = columns[i].template;
|
9934
|
+
columns[i].template = initializeCSPTemplate(function (data) {
|
9935
|
+
const name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
9936
|
+
return template.replace(/\${name}/g, name);
|
9937
|
+
});
|
9938
|
+
}
|
9813
9939
|
}
|
9814
9940
|
}
|
9815
9941
|
const iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '54' : '46');
|
@@ -9965,9 +10091,12 @@ class DetailsView {
|
|
9965
10091
|
}
|
9966
10092
|
onBeforeDataBound(args) {
|
9967
10093
|
showSpinner(this.parent.element);
|
9968
|
-
|
9969
|
-
|
9970
|
-
|
10094
|
+
let nameColumn = this.parent.detailsViewSettings.columns.find((column) => column.field === this.parent.sortBy);
|
10095
|
+
if (nameColumn && !('sortComparer' in nameColumn)) {
|
10096
|
+
// eslint-disable-next-line
|
10097
|
+
const items = getSortedData(this.parent, (this.parent.enableVirtualization) ? args.result : this.gridObj.dataSource);
|
10098
|
+
args.result = items;
|
10099
|
+
}
|
9971
10100
|
}
|
9972
10101
|
/* istanbul ignore next */
|
9973
10102
|
onDataBound() {
|
@@ -10843,12 +10972,14 @@ class DetailsView {
|
|
10843
10972
|
eventName: 'keydown'
|
10844
10973
|
});
|
10845
10974
|
EventHandler.add(this.gridObj.element, 'blur', this.removeFocus, this);
|
10975
|
+
EventHandler.add(this.parent.element, 'focusout', this.onBlur, this);
|
10846
10976
|
}
|
10847
10977
|
unWireEvents() {
|
10848
10978
|
this.wireClickEvent(false);
|
10849
10979
|
this.keyboardModule.destroy();
|
10850
10980
|
this.keyboardDownModule.destroy();
|
10851
10981
|
EventHandler.remove(this.gridObj.element, 'blur', this.removeFocus);
|
10982
|
+
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
10852
10983
|
}
|
10853
10984
|
wireClickEvent(toBind) {
|
10854
10985
|
if (toBind) {
|
@@ -10898,6 +11029,19 @@ class DetailsView {
|
|
10898
11029
|
removeFocus() {
|
10899
11030
|
this.addFocus(null);
|
10900
11031
|
}
|
11032
|
+
onBlur(e) {
|
11033
|
+
if ((e.relatedTarget !== null && closest(e.relatedTarget, '.e-grid') !== e.relatedTarget)) {
|
11034
|
+
return;
|
11035
|
+
}
|
11036
|
+
if (!isNullOrUndefined(this.gridObj.element)) {
|
11037
|
+
const thElements = this.gridObj.element.querySelectorAll('th');
|
11038
|
+
for (let i = 0; i < thElements.length; i++) {
|
11039
|
+
if (thElements[i].classList.contains('e-focus')) {
|
11040
|
+
this.addFocus(null);
|
11041
|
+
}
|
11042
|
+
}
|
11043
|
+
}
|
11044
|
+
}
|
10901
11045
|
getFocusedItemIndex() {
|
10902
11046
|
return (!isNullOrUndefined(this.getFocusedItem())) ?
|
10903
11047
|
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
@@ -10946,6 +11090,8 @@ class DetailsView {
|
|
10946
11090
|
break;
|
10947
11091
|
}
|
10948
11092
|
}
|
11093
|
+
/* istanbul ignore next */
|
11094
|
+
// eslint:disable-next-line
|
10949
11095
|
keyupHandler(e) {
|
10950
11096
|
if (!this.isRendered) {
|
10951
11097
|
return;
|
@@ -10976,7 +11122,15 @@ class DetailsView {
|
|
10976
11122
|
this.performDelete();
|
10977
11123
|
break;
|
10978
11124
|
case 'enter':
|
10979
|
-
if (this.gridObj.selectedRowIndex === -1) {
|
11125
|
+
if (this.gridObj.selectedRowIndex === -1 && this.gridObj.allowSorting === true) {
|
11126
|
+
if (!e.target.classList.contains('e-fe-grid-icon')) {
|
11127
|
+
const direction = !e.target.getElementsByClassName('e-ascending').length ? 'Ascending' : 'Descending';
|
11128
|
+
const currentField = this.gridObj.getColumnByUid(e.target.querySelector('.e-headercelldiv').getAttribute('e-mappinguid')).field;
|
11129
|
+
this.gridObj.sortColumn(currentField, direction);
|
11130
|
+
if (!isNullOrUndefined(this.getFocusedItem().nextSibling)) {
|
11131
|
+
this.getFocusedItem().nextSibling.setAttribute('tabindex', '0');
|
11132
|
+
}
|
11133
|
+
}
|
10980
11134
|
break;
|
10981
11135
|
}
|
10982
11136
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
@@ -11023,13 +11177,8 @@ class DetailsView {
|
|
11023
11177
|
else if (this.gridObj.selectedRowIndex !== -1 && e.action === 'tab') {
|
11024
11178
|
return;
|
11025
11179
|
}
|
11026
|
-
else if (!this.actionDivert) {
|
11027
|
-
this.addHeaderFocus();
|
11028
|
-
this.actionDivert = true;
|
11029
|
-
}
|
11030
11180
|
else {
|
11031
|
-
this.
|
11032
|
-
this.actionDivert = false;
|
11181
|
+
this.addHeaderFocus(e);
|
11033
11182
|
}
|
11034
11183
|
}
|
11035
11184
|
break;
|
@@ -11316,16 +11465,29 @@ class DetailsView {
|
|
11316
11465
|
addClass([itemElement], [FOCUS, FOCUSED]);
|
11317
11466
|
}
|
11318
11467
|
}
|
11319
|
-
addHeaderFocus() {
|
11468
|
+
addHeaderFocus(e) {
|
11320
11469
|
const treeFocus = select('.e-row', this.element);
|
11321
11470
|
this.gridObj.element.setAttribute('tabindex', '-1');
|
11322
|
-
|
11323
|
-
|
11324
|
-
|
11325
|
-
|
11326
|
-
|
11327
|
-
if (
|
11328
|
-
|
11471
|
+
let nameFocus;
|
11472
|
+
if (!isNullOrUndefined(e.target) && e.target.classList.contains('e-defaultcursor')) {
|
11473
|
+
this.addFocus(0);
|
11474
|
+
nameFocus = e.target.nextElementSibling;
|
11475
|
+
}
|
11476
|
+
else if (!isNullOrUndefined(this.gridObj.element.querySelector('.e-focus')) && (this.gridObj.element.querySelector('.e-focus').tagName === 'TH')) {
|
11477
|
+
nameFocus = this.gridObj.element.querySelector('.e-focus').nextElementSibling;
|
11478
|
+
this.addFocus(0);
|
11479
|
+
}
|
11480
|
+
else {
|
11481
|
+
nameFocus = select('th.e-fe-grid-icon', this.element);
|
11482
|
+
}
|
11483
|
+
if (!isNullOrUndefined(nameFocus)) {
|
11484
|
+
nameFocus.setAttribute('tabindex', '0');
|
11485
|
+
nameFocus.focus();
|
11486
|
+
addClass([nameFocus], [FOCUS, FOCUSED]);
|
11487
|
+
treeFocus.setAttribute('tabindex', '0');
|
11488
|
+
if (treeFocus.tabIndex === 0 && nameFocus.tabIndex === 0) {
|
11489
|
+
removeClass([treeFocus], [FOCUS, FOCUSED]);
|
11490
|
+
}
|
11329
11491
|
}
|
11330
11492
|
}
|
11331
11493
|
getFocusedItem() {
|
@@ -11538,5 +11700,5 @@ class DetailsView {
|
|
11538
11700
|
* File Manager all modules
|
11539
11701
|
*/
|
11540
11702
|
|
11541
|
-
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 };
|
11703
|
+
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 };
|
11542
11704
|
//# sourceMappingURL=ej2-filemanager.es2015.js.map
|