@syncfusion/ej2-filemanager 19.4.42 → 19.4.50

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/ej2-filemanager.umd.min.js +2 -2
  3. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-filemanager.es2015.js +83 -18
  5. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  6. package/dist/es6/ej2-filemanager.es5.js +83 -18
  7. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  8. package/dist/global/ej2-filemanager.min.js +2 -2
  9. package/dist/global/ej2-filemanager.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +15 -16
  12. package/src/file-manager/base/file-manager-model.d.ts +1 -1
  13. package/src/file-manager/base/file-manager.d.ts +2 -0
  14. package/src/file-manager/base/file-manager.js +8 -0
  15. package/src/file-manager/base/interface.d.ts +2 -0
  16. package/src/file-manager/common/utility.js +8 -1
  17. package/src/file-manager/layout/large-icons-view.d.ts +1 -1
  18. package/src/file-manager/layout/navigation-pane.d.ts +5 -0
  19. package/src/file-manager/layout/navigation-pane.js +55 -10
  20. package/src/file-manager/pop-up/context-menu.d.ts +1 -0
  21. package/src/file-manager/pop-up/context-menu.js +12 -7
  22. package/styles/bootstrap-dark.css +4 -0
  23. package/styles/bootstrap.css +4 -0
  24. package/styles/bootstrap4.css +4 -0
  25. package/styles/bootstrap5-dark.css +4 -0
  26. package/styles/bootstrap5.css +4 -0
  27. package/styles/fabric-dark.css +4 -0
  28. package/styles/fabric.css +4 -0
  29. package/styles/file-manager/_layout.scss +6 -0
  30. package/styles/file-manager/bootstrap-dark.css +4 -0
  31. package/styles/file-manager/bootstrap.css +4 -0
  32. package/styles/file-manager/bootstrap4.css +4 -0
  33. package/styles/file-manager/bootstrap5-dark.css +4 -0
  34. package/styles/file-manager/bootstrap5.css +4 -0
  35. package/styles/file-manager/fabric-dark.css +4 -0
  36. package/styles/file-manager/fabric.css +4 -0
  37. package/styles/file-manager/highcontrast-light.css +4 -0
  38. package/styles/file-manager/highcontrast.css +4 -0
  39. package/styles/file-manager/material-dark.css +4 -0
  40. package/styles/file-manager/material.css +4 -0
  41. package/styles/file-manager/tailwind-dark.css +4 -0
  42. package/styles/file-manager/tailwind.css +4 -0
  43. package/styles/highcontrast-light.css +4 -0
  44. package/styles/highcontrast.css +4 -0
  45. package/styles/material-dark.css +4 -0
  46. package/styles/material.css +4 -0
  47. package/styles/tailwind-dark.css +4 -0
  48. package/styles/tailwind.css +4 -0
@@ -875,7 +875,13 @@ function searchWordHandler(parent, value, isLayoutChange) {
875
875
  }
876
876
  else {
877
877
  if (!parent.isFiltered) {
878
- read(parent, isLayoutChange ? layoutChange : search, parent.path);
878
+ if (parent.isSortByClicked) {
879
+ parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
880
+ parent.isSortByClicked = false;
881
+ }
882
+ else {
883
+ read(parent, isLayoutChange ? layoutChange : search, parent.path);
884
+ }
879
885
  }
880
886
  else {
881
887
  filter(parent, layoutChange);
@@ -1286,6 +1292,7 @@ function getCssClass(parent, css) {
1286
1292
  */
1287
1293
  function sortbyClickHandler(parent, args) {
1288
1294
  let tick;
1295
+ parent.isSortByClicked = true;
1289
1296
  if (args.item.id.indexOf('ascending') !== -1 || args.item.id.indexOf('descending') !== -1 || args.item.id.indexOf('none') !== -1) {
1290
1297
  tick = true;
1291
1298
  }
@@ -5701,14 +5708,11 @@ class ContextMenu$2 {
5701
5708
  let data;
5702
5709
  let treeFolder = false;
5703
5710
  let target = args.event.target;
5704
- this.menuTarget = target;
5711
+ this.menuTarget = this.targetNodeElement = target;
5705
5712
  this.currentElement = args.element;
5706
5713
  if (target.classList.contains('e-spinner-pane')) {
5707
5714
  target = this.parent.navigationpaneModule.activeNode.getElementsByClassName(FULLROW)[0];
5708
- this.menuTarget = target;
5709
- }
5710
- if (target.classList.contains(FULLROW)) {
5711
- this.parent.selectedItems.length = 0;
5715
+ this.menuTarget = this.targetNodeElement = target;
5712
5716
  }
5713
5717
  this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
5714
5718
  const view = this.getTargetView(target);
@@ -5819,7 +5823,7 @@ class ContextMenu$2 {
5819
5823
  this.enableItems(this.disabledItems, false, true);
5820
5824
  args.cancel = menuOpenArgs.cancel;
5821
5825
  if (menuOpenArgs.cancel) {
5822
- this.menuTarget = this.currentElement = null;
5826
+ this.menuTarget = this.targetNodeElement = this.currentElement = null;
5823
5827
  }
5824
5828
  });
5825
5829
  }
@@ -5938,7 +5942,12 @@ class ContextMenu$2 {
5938
5942
  }
5939
5943
  else {
5940
5944
  this.parent.notify(selectedData, {});
5941
- details = this.parent.itemData;
5945
+ if (this.parent.activeModule === 'navigationpane' && itemText === 'open') {
5946
+ details = [this.menuItemData];
5947
+ }
5948
+ else {
5949
+ details = this.parent.itemData;
5950
+ }
5942
5951
  }
5943
5952
  const eventArgs = {
5944
5953
  cancel: false,
@@ -6015,6 +6024,9 @@ class ContextMenu$2 {
6015
6024
  if (this.parent.visitedItem) {
6016
6025
  this.parent.notify(openInit, { target: this.parent.visitedItem });
6017
6026
  }
6027
+ else if (this.parent.activeModule === 'navigationpane') {
6028
+ this.parent.navigationpaneModule.openFileOnContextMenuClick(closest(this.targetNodeElement, 'li'));
6029
+ }
6018
6030
  break;
6019
6031
  case 'details':
6020
6032
  this.parent.notify(detailsInit, {});
@@ -6372,6 +6384,8 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6372
6384
  this.folderPath = '';
6373
6385
  this.isSameAction = false;
6374
6386
  this.isFiltered = false;
6387
+ // Specifies whether the sort by option is clicked or not.
6388
+ this.isSortByClicked = false;
6375
6389
  this.enablePaste = false;
6376
6390
  this.persistData = false;
6377
6391
  this.retryArgs = [];
@@ -6700,6 +6714,7 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6700
6714
  enableRtl: this.enableRtl,
6701
6715
  uploading: this.onUploading.bind(this),
6702
6716
  removing: this.onRemoving.bind(this),
6717
+ canceling: this.onCancel.bind(this),
6703
6718
  clearing: this.onClearing.bind(this),
6704
6719
  selected: this.onSelected.bind(this),
6705
6720
  success: this.onUploadSuccess.bind(this),
@@ -6807,6 +6822,11 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6807
6822
  }
6808
6823
  }
6809
6824
  /* istanbul ignore next */
6825
+ onCancel(args) {
6826
+ const data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
6827
+ args.customFormData = [{ 'path': this.path }, { 'action': 'remove' }, { 'data': data }];
6828
+ }
6829
+ /* istanbul ignore next */
6810
6830
  onClearing() {
6811
6831
  if (this.isOpened) {
6812
6832
  this.uploadDialogObj.hide();
@@ -8051,6 +8071,12 @@ class NavigationPane {
8051
8071
  this.isRenameParent = false;
8052
8072
  this.isRightClick = false;
8053
8073
  this.renameParent = null;
8074
+ // Specifies the previously selected nodes in the treeview control.
8075
+ this.previousSelected = null;
8076
+ // Specifies whether the nodeClicked event of the treeview control is triggered or not.
8077
+ this.isNodeClickCalled = false;
8078
+ // Specifies whether to restrict node selection in the treeview control.
8079
+ this.restrictSelecting = false;
8054
8080
  this.parent = parent;
8055
8081
  this.addEventListener();
8056
8082
  this.keyConfigs = {
@@ -8090,6 +8116,7 @@ class NavigationPane {
8090
8116
  hasChildren: 'hasChild', iconCss: '_fm_icon', htmlAttributes: '_fm_htmlAttr', tooltip: 'name'
8091
8117
  },
8092
8118
  enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
8119
+ nodeSelecting: this.onNodeSelecting.bind(this),
8093
8120
  nodeSelected: this.onNodeSelected.bind(this),
8094
8121
  nodeExpanding: this.onNodeExpand.bind(this),
8095
8122
  nodeClicked: this.onNodeClicked.bind(this),
@@ -8194,6 +8221,44 @@ class NavigationPane {
8194
8221
  this.treeObj.addNodes(directories, target, null, prevent);
8195
8222
  }
8196
8223
  }
8224
+ // Node Selecting event handler
8225
+ onNodeSelecting(args) {
8226
+ if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
8227
+ this.restrictSelecting = false;
8228
+ this.isNodeClickCalled = false;
8229
+ return;
8230
+ }
8231
+ if (!this.renameParent) {
8232
+ this.parent.activeModule = 'navigationpane';
8233
+ // eslint-disable-next-line
8234
+ const nodeData = this.getTreeData(getValue('id', args.nodeData));
8235
+ const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8236
+ this.parent.trigger('fileOpen', eventArgs);
8237
+ args.cancel = eventArgs.cancel;
8238
+ if (args.cancel) {
8239
+ this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] != args.node.getAttribute('data-uid') : false;
8240
+ this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
8241
+ this.previousSelected = this.treeObj.selectedNodes;
8242
+ if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
8243
+ this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
8244
+ }
8245
+ }
8246
+ }
8247
+ }
8248
+ // Opens the folder while clicking open context menu item in the treeview.
8249
+ openFileOnContextMenuClick(node) {
8250
+ const data = this.treeObj.getTreeData(node);
8251
+ // eslint-disable-next-line
8252
+ this.parent.selectedItems = [];
8253
+ this.parent.itemData = data;
8254
+ this.activeNode = node;
8255
+ this.parent.activeModule = 'navigationpane';
8256
+ updatePath(node, this.parent.itemData[0], this.parent);
8257
+ read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8258
+ this.parent.visitedItem = node;
8259
+ this.isPathDragged = this.isRenameParent = this.isRightClick = false;
8260
+ this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
8261
+ }
8197
8262
  onNodeSelected(args) {
8198
8263
  if (this.parent.breadcrumbbarModule && this.parent.breadcrumbbarModule.searchObj && !this.renameParent) {
8199
8264
  this.parent.breadcrumbbarModule.searchObj.element.value = '';
@@ -8207,20 +8272,18 @@ class NavigationPane {
8207
8272
  this.parent.activeModule = 'navigationpane';
8208
8273
  // eslint-disable-next-line
8209
8274
  const nodeData = this.getTreeData(getValue('id', args.nodeData));
8210
- if (!this.renameParent) {
8211
- const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8212
- delete eventArgs.cancel;
8213
- this.parent.trigger('fileOpen', eventArgs);
8214
- }
8215
8275
  this.parent.selectedItems = [];
8216
8276
  this.parent.itemData = nodeData;
8277
+ let previousPath = this.parent.path;
8217
8278
  updatePath(args.node, this.parent.itemData[0], this.parent);
8218
- this.expandNodeTarget = null;
8219
- if (args.node.querySelector('.' + ICONS) && args.node.querySelector('.' + LIST_ITEM) === null) {
8220
- this.expandNodeTarget = 'add';
8279
+ if (previousPath !== this.parent.path) {
8280
+ this.expandNodeTarget = null;
8281
+ if (args.node.querySelector('.' + ICONS) && args.node.querySelector('.' + LIST_ITEM) === null) {
8282
+ this.expandNodeTarget = 'add';
8283
+ }
8284
+ read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8285
+ this.parent.visitedItem = args.node;
8221
8286
  }
8222
- read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8223
- this.parent.visitedItem = args.node;
8224
8287
  this.isPathDragged = this.isRenameParent = this.isRightClick = false;
8225
8288
  }
8226
8289
  /* istanbul ignore next */
@@ -8253,9 +8316,11 @@ class NavigationPane {
8253
8316
  }
8254
8317
  onNodeClicked(args) {
8255
8318
  this.parent.activeModule = 'navigationpane';
8319
+ this.previousSelected = this.treeObj.selectedNodes;
8256
8320
  this.activeNode = args.node;
8257
8321
  if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
8258
8322
  this.isRightClick = true;
8323
+ this.isNodeClickCalled = true;
8259
8324
  this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
8260
8325
  }
8261
8326
  else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {