@syncfusion/ej2-filemanager 19.3.53 → 19.4.43
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 +244 -0
- package/CHANGELOG.md +17 -1
- package/README.md +1 -1
- 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 +74 -18
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +74 -18
- 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 +15 -15
- package/src/file-manager/actions/breadcrumb-bar.js +1 -1
- package/src/file-manager/base/file-manager-model.d.ts +1 -1
- package/src/file-manager/base/file-manager.js +4 -1
- package/src/file-manager/base/interface.d.ts +1 -0
- package/src/file-manager/common/operations.js +1 -1
- package/src/file-manager/common/utility.js +2 -2
- package/src/file-manager/layout/details-view.js +1 -1
- package/src/file-manager/layout/navigation-pane.d.ts +5 -0
- package/src/file-manager/layout/navigation-pane.js +47 -5
- package/src/file-manager/models/default-locale.js +1 -1
- package/src/file-manager/models/search-settings-model.d.ts +8 -0
- package/src/file-manager/models/search-settings.d.ts +7 -0
- package/src/file-manager/models/search-settings.js +3 -0
- package/src/file-manager/pop-up/context-menu.d.ts +1 -0
- package/src/file-manager/pop-up/context-menu.js +14 -6
- package/styles/bootstrap-dark.css +2 -2
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +2 -2
- package/styles/bootstrap5-dark.css +8 -3
- package/styles/bootstrap5.css +8 -3
- package/styles/fabric-dark.css +3 -3
- package/styles/fabric.css +4 -4
- package/styles/file-manager/_bootstrap-dark-definition.scss +1 -1
- package/styles/file-manager/_bootstrap-definition.scss +1 -1
- package/styles/file-manager/_bootstrap4-definition.scss +1 -1
- package/styles/file-manager/_fabric-dark-definition.scss +2 -2
- package/styles/file-manager/_fabric-definition.scss +3 -3
- package/styles/file-manager/_fluent-definition.scss +245 -0
- package/styles/file-manager/_layout.scss +29 -5
- package/styles/file-manager/_material-definition.scss +1 -1
- package/styles/file-manager/_tailwind-definition.scss +2 -2
- package/styles/file-manager/bootstrap-dark.css +2 -2
- package/styles/file-manager/bootstrap.css +1 -1
- package/styles/file-manager/bootstrap4.css +2 -2
- package/styles/file-manager/bootstrap5-dark.css +8 -3
- package/styles/file-manager/bootstrap5.css +8 -3
- package/styles/file-manager/fabric-dark.css +3 -3
- package/styles/file-manager/fabric.css +4 -4
- package/styles/file-manager/icons/_fluent.scss +235 -0
- package/styles/file-manager/material-dark.css +6 -0
- package/styles/file-manager/material.css +7 -1
- package/styles/file-manager/tailwind-dark.css +4 -4
- package/styles/file-manager/tailwind.css +4 -4
- package/styles/material-dark.css +6 -0
- package/styles/material.css +7 -1
- package/styles/tailwind-dark.css +4 -4
- package/styles/tailwind.css +4 -4
- package/tslint.json +111 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Ajax, Browser, ChildProperty, Complex, Component, Draggable, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, createElement, detach, extend, formatUnit, getValue, isNullOrUndefined, isVisible, matches, remove, removeClass, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
1
|
+
import { Ajax, Browser, ChildProperty, Complex, Component, Draggable, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, createElement, detach, extend, formatUnit, getUniqueID, getValue, 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
4
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
@@ -73,6 +73,9 @@ __decorate$2([
|
|
73
73
|
__decorate$2([
|
74
74
|
Property(true)
|
75
75
|
], SearchSettings.prototype, "ignoreCase", void 0);
|
76
|
+
__decorate$2([
|
77
|
+
Property(null)
|
78
|
+
], SearchSettings.prototype, "placeholder", void 0);
|
76
79
|
|
77
80
|
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
78
81
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
@@ -1053,7 +1056,7 @@ function fileType(file) {
|
|
1053
1056
|
function getImageUrl(parent, item) {
|
1054
1057
|
const baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
|
1055
1058
|
let imgUrl;
|
1056
|
-
const fileName = getValue('name', item);
|
1059
|
+
const fileName = encodeURIComponent(getValue('name', item));
|
1057
1060
|
const fPath = getValue('filterPath', item);
|
1058
1061
|
if (parent.hasId) {
|
1059
1062
|
const imgId = getValue('id', item);
|
@@ -1627,7 +1630,7 @@ function createVirtualDragElement(parent) {
|
|
1627
1630
|
parent.dragNodes.push(parent.selectedItems[i]);
|
1628
1631
|
i++;
|
1629
1632
|
}
|
1630
|
-
if (parent.selectedItems.length
|
1633
|
+
if (parent.selectedItems.length === 0 && parent.dragData && parent.dragData.length === 1) {
|
1631
1634
|
parent.dragNodes.push(getItemName(parent, parent.dragData[0]));
|
1632
1635
|
}
|
1633
1636
|
}
|
@@ -2145,7 +2148,7 @@ function filter(parent, event) {
|
|
2145
2148
|
let filterData;
|
2146
2149
|
// eslint-disable-next-line
|
2147
2150
|
const filterDataVal = parent.filterData ? extend(filterData, data, parent.filterData) : data;
|
2148
|
-
createAjax(parent,
|
2151
|
+
createAjax(parent, filterDataVal, filterSuccess, event, getValue('action', filterDataVal));
|
2149
2152
|
}
|
2150
2153
|
/**
|
2151
2154
|
* Function to rename the folder/file in File Manager.
|
@@ -5630,7 +5633,7 @@ class BreadCrumbBar {
|
|
5630
5633
|
}
|
5631
5634
|
}
|
5632
5635
|
onSearchTextChange(args) {
|
5633
|
-
this.searchObj.element.placeholder = getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
|
5636
|
+
this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
|
5634
5637
|
}
|
5635
5638
|
}
|
5636
5639
|
|
@@ -5698,16 +5701,16 @@ class ContextMenu$2 {
|
|
5698
5701
|
let data;
|
5699
5702
|
let treeFolder = false;
|
5700
5703
|
let target = args.event.target;
|
5701
|
-
this.menuTarget = target;
|
5704
|
+
this.menuTarget = this.targetNodeElement = target;
|
5702
5705
|
this.currentElement = args.element;
|
5703
5706
|
if (target.classList.contains('e-spinner-pane')) {
|
5704
5707
|
target = this.parent.navigationpaneModule.activeNode.getElementsByClassName(FULLROW)[0];
|
5705
|
-
this.menuTarget = target;
|
5708
|
+
this.menuTarget = this.targetNodeElement = target;
|
5706
5709
|
}
|
5707
5710
|
if (target.classList.contains(FULLROW)) {
|
5708
5711
|
this.parent.selectedItems.length = 0;
|
5709
5712
|
}
|
5710
|
-
this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr') : target;
|
5713
|
+
this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
|
5711
5714
|
const view = this.getTargetView(target);
|
5712
5715
|
this.updateActiveModule();
|
5713
5716
|
/* istanbul ignore next */
|
@@ -5739,7 +5742,7 @@ class ContextMenu$2 {
|
|
5739
5742
|
data = this.parent.visitedData;
|
5740
5743
|
selected = true;
|
5741
5744
|
}
|
5742
|
-
else if (!isNullOrUndefined(closest(target, 'tr'))) {
|
5745
|
+
else if (!isNullOrUndefined(closest(target, 'tr.e-row'))) {
|
5743
5746
|
uid = this.targetElement.getAttribute('data-uid');
|
5744
5747
|
// eslint-disable-next-line
|
5745
5748
|
data = this.parent.detailsviewModule.gridObj.getRowObjectFromUID(uid).data;
|
@@ -5816,7 +5819,7 @@ class ContextMenu$2 {
|
|
5816
5819
|
this.enableItems(this.disabledItems, false, true);
|
5817
5820
|
args.cancel = menuOpenArgs.cancel;
|
5818
5821
|
if (menuOpenArgs.cancel) {
|
5819
|
-
this.menuTarget = this.currentElement = null;
|
5822
|
+
this.menuTarget = this.targetNodeElement = this.currentElement = null;
|
5820
5823
|
}
|
5821
5824
|
});
|
5822
5825
|
}
|
@@ -5935,7 +5938,12 @@ class ContextMenu$2 {
|
|
5935
5938
|
}
|
5936
5939
|
else {
|
5937
5940
|
this.parent.notify(selectedData, {});
|
5938
|
-
|
5941
|
+
if (this.parent.activeModule === 'navigationpane' && itemText === 'open') {
|
5942
|
+
details = [this.menuItemData];
|
5943
|
+
}
|
5944
|
+
else {
|
5945
|
+
details = this.parent.itemData;
|
5946
|
+
}
|
5939
5947
|
}
|
5940
5948
|
const eventArgs = {
|
5941
5949
|
cancel: false,
|
@@ -6012,6 +6020,9 @@ class ContextMenu$2 {
|
|
6012
6020
|
if (this.parent.visitedItem) {
|
6013
6021
|
this.parent.notify(openInit, { target: this.parent.visitedItem });
|
6014
6022
|
}
|
6023
|
+
else if (this.parent.activeModule === 'navigationpane') {
|
6024
|
+
this.parent.navigationpaneModule.openFileOnContextMenuClick(closest(this.targetNodeElement, 'li'));
|
6025
|
+
}
|
6015
6026
|
break;
|
6016
6027
|
case 'details':
|
6017
6028
|
this.parent.notify(detailsInit, {});
|
@@ -6310,7 +6321,7 @@ const defaultLocale = {
|
|
6310
6321
|
'Filter-Empty': 'No results found',
|
6311
6322
|
'Filter-Key': 'Try with different filter',
|
6312
6323
|
'Sub-Folder-Error': 'The destination folder is the subfolder of the source folder.',
|
6313
|
-
|
6324
|
+
'Same-Folder-Error': 'The destination folder is the same as the source folder.',
|
6314
6325
|
'Access-Denied': 'Access Denied',
|
6315
6326
|
'Access-Details': 'You don"t have permission to access this folder.',
|
6316
6327
|
'Header-Retry': 'File Already Exists',
|
@@ -6410,6 +6421,9 @@ let FileManager = FileManager_1 = class FileManager extends Component {
|
|
6410
6421
|
* @returns {void}
|
6411
6422
|
*/
|
6412
6423
|
preRender() {
|
6424
|
+
if (isNullOrUndefined(this.element.id) || this.element.id === '') {
|
6425
|
+
this.element.setAttribute('id', getUniqueID('filemanager'));
|
6426
|
+
}
|
6413
6427
|
this.ensurePath();
|
6414
6428
|
this.feParent = [];
|
6415
6429
|
this.feFiles = [];
|
@@ -8045,6 +8059,12 @@ class NavigationPane {
|
|
8045
8059
|
this.isRenameParent = false;
|
8046
8060
|
this.isRightClick = false;
|
8047
8061
|
this.renameParent = null;
|
8062
|
+
// Specifies the previously selected nodes in the treeview control.
|
8063
|
+
this.previousSelected = null;
|
8064
|
+
// Specifies whether the nodeClicked event of the treeview control is triggered or not.
|
8065
|
+
this.isNodeClickCalled = false;
|
8066
|
+
// Specifies whether to restrict node selection in the treeview control.
|
8067
|
+
this.restrictSelecting = false;
|
8048
8068
|
this.parent = parent;
|
8049
8069
|
this.addEventListener();
|
8050
8070
|
this.keyConfigs = {
|
@@ -8084,6 +8104,7 @@ class NavigationPane {
|
|
8084
8104
|
hasChildren: 'hasChild', iconCss: '_fm_icon', htmlAttributes: '_fm_htmlAttr', tooltip: 'name'
|
8085
8105
|
},
|
8086
8106
|
enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
|
8107
|
+
nodeSelecting: this.onNodeSelecting.bind(this),
|
8087
8108
|
nodeSelected: this.onNodeSelected.bind(this),
|
8088
8109
|
nodeExpanding: this.onNodeExpand.bind(this),
|
8089
8110
|
nodeClicked: this.onNodeClicked.bind(this),
|
@@ -8188,6 +8209,44 @@ class NavigationPane {
|
|
8188
8209
|
this.treeObj.addNodes(directories, target, null, prevent);
|
8189
8210
|
}
|
8190
8211
|
}
|
8212
|
+
// Node Selecting event handler
|
8213
|
+
onNodeSelecting(args) {
|
8214
|
+
if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
|
8215
|
+
this.restrictSelecting = false;
|
8216
|
+
return;
|
8217
|
+
}
|
8218
|
+
if (!this.renameParent) {
|
8219
|
+
this.parent.activeModule = 'navigationpane';
|
8220
|
+
// eslint-disable-next-line
|
8221
|
+
const nodeData = this.getTreeData(getValue('id', args.nodeData));
|
8222
|
+
const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
|
8223
|
+
delete eventArgs.cancel;
|
8224
|
+
this.parent.trigger('fileOpen', eventArgs);
|
8225
|
+
args.cancel = eventArgs.cancel;
|
8226
|
+
if (args.cancel) {
|
8227
|
+
this.restrictSelecting = true;
|
8228
|
+
this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
|
8229
|
+
this.isNodeClickCalled = false;
|
8230
|
+
if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
|
8231
|
+
this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
|
8232
|
+
}
|
8233
|
+
}
|
8234
|
+
}
|
8235
|
+
}
|
8236
|
+
// Opens the folder while clicking open context menu item in the treeview.
|
8237
|
+
openFileOnContextMenuClick(node) {
|
8238
|
+
const data = this.treeObj.getTreeData(node);
|
8239
|
+
// eslint-disable-next-line
|
8240
|
+
this.parent.selectedItems = [];
|
8241
|
+
this.parent.itemData = data;
|
8242
|
+
this.activeNode = node;
|
8243
|
+
this.parent.activeModule = 'navigationpane';
|
8244
|
+
updatePath(node, this.parent.itemData[0], this.parent);
|
8245
|
+
read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
|
8246
|
+
this.parent.visitedItem = node;
|
8247
|
+
this.isPathDragged = this.isRenameParent = this.isRightClick = false;
|
8248
|
+
this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
|
8249
|
+
}
|
8191
8250
|
onNodeSelected(args) {
|
8192
8251
|
if (this.parent.breadcrumbbarModule && this.parent.breadcrumbbarModule.searchObj && !this.renameParent) {
|
8193
8252
|
this.parent.breadcrumbbarModule.searchObj.element.value = '';
|
@@ -8201,11 +8260,6 @@ class NavigationPane {
|
|
8201
8260
|
this.parent.activeModule = 'navigationpane';
|
8202
8261
|
// eslint-disable-next-line
|
8203
8262
|
const nodeData = this.getTreeData(getValue('id', args.nodeData));
|
8204
|
-
if (!this.renameParent) {
|
8205
|
-
const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
|
8206
|
-
delete eventArgs.cancel;
|
8207
|
-
this.parent.trigger('fileOpen', eventArgs);
|
8208
|
-
}
|
8209
8263
|
this.parent.selectedItems = [];
|
8210
8264
|
this.parent.itemData = nodeData;
|
8211
8265
|
updatePath(args.node, this.parent.itemData[0], this.parent);
|
@@ -8250,6 +8304,8 @@ class NavigationPane {
|
|
8250
8304
|
this.activeNode = args.node;
|
8251
8305
|
if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
|
8252
8306
|
this.isRightClick = true;
|
8307
|
+
this.isNodeClickCalled = true;
|
8308
|
+
this.previousSelected = this.treeObj.selectedNodes;
|
8253
8309
|
this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
|
8254
8310
|
}
|
8255
8311
|
else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {
|
@@ -9686,7 +9742,7 @@ class DetailsView {
|
|
9686
9742
|
// eslint-disable-next-line
|
9687
9743
|
this.parent.dragData = this.gridObj.getSelectedRecords();
|
9688
9744
|
let dragRow;
|
9689
|
-
if (this.parent.dragData.length
|
9745
|
+
if (this.parent.dragData.length === 0 && dragLi) {
|
9690
9746
|
dragRow = this.gridObj.getRowInfo(dragLi);
|
9691
9747
|
}
|
9692
9748
|
if (dragRow) {
|