@syncfusion/ej2-filemanager 19.3.55 → 19.4.47

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 (58) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/README.md +1 -1
  3. package/dist/ej2-filemanager.umd.min.js +2 -2
  4. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-filemanager.es2015.js +80 -18
  6. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  7. package/dist/es6/ej2-filemanager.es5.js +80 -18
  8. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  9. package/dist/global/ej2-filemanager.min.js +2 -2
  10. package/dist/global/ej2-filemanager.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +15 -15
  13. package/src/file-manager/actions/breadcrumb-bar.js +1 -1
  14. package/src/file-manager/base/file-manager-model.d.ts +1 -1
  15. package/src/file-manager/base/file-manager.d.ts +1 -0
  16. package/src/file-manager/base/file-manager.js +6 -1
  17. package/src/file-manager/base/interface.d.ts +2 -0
  18. package/src/file-manager/common/utility.js +9 -2
  19. package/src/file-manager/layout/large-icons-view.d.ts +1 -1
  20. package/src/file-manager/layout/navigation-pane.d.ts +5 -0
  21. package/src/file-manager/layout/navigation-pane.js +47 -5
  22. package/src/file-manager/models/search-settings-model.d.ts +8 -0
  23. package/src/file-manager/models/search-settings.d.ts +7 -0
  24. package/src/file-manager/models/search-settings.js +3 -0
  25. package/src/file-manager/pop-up/context-menu.d.ts +1 -0
  26. package/src/file-manager/pop-up/context-menu.js +14 -9
  27. package/styles/bootstrap-dark.css +2 -2
  28. package/styles/bootstrap.css +1 -1
  29. package/styles/bootstrap4.css +2 -2
  30. package/styles/bootstrap5-dark.css +8 -3
  31. package/styles/bootstrap5.css +8 -3
  32. package/styles/fabric-dark.css +3 -3
  33. package/styles/fabric.css +4 -4
  34. package/styles/file-manager/_bootstrap-dark-definition.scss +1 -1
  35. package/styles/file-manager/_bootstrap-definition.scss +1 -1
  36. package/styles/file-manager/_bootstrap4-definition.scss +1 -1
  37. package/styles/file-manager/_fabric-dark-definition.scss +2 -2
  38. package/styles/file-manager/_fabric-definition.scss +3 -3
  39. package/styles/file-manager/_fluent-definition.scss +245 -0
  40. package/styles/file-manager/_layout.scss +29 -5
  41. package/styles/file-manager/_material-definition.scss +1 -1
  42. package/styles/file-manager/_tailwind-definition.scss +2 -2
  43. package/styles/file-manager/bootstrap-dark.css +2 -2
  44. package/styles/file-manager/bootstrap.css +1 -1
  45. package/styles/file-manager/bootstrap4.css +2 -2
  46. package/styles/file-manager/bootstrap5-dark.css +8 -3
  47. package/styles/file-manager/bootstrap5.css +8 -3
  48. package/styles/file-manager/fabric-dark.css +3 -3
  49. package/styles/file-manager/fabric.css +4 -4
  50. package/styles/file-manager/icons/_fluent.scss +235 -0
  51. package/styles/file-manager/material-dark.css +6 -0
  52. package/styles/file-manager/material.css +7 -1
  53. package/styles/file-manager/tailwind-dark.css +4 -4
  54. package/styles/file-manager/tailwind.css +4 -4
  55. package/styles/material-dark.css +6 -0
  56. package/styles/material.css +7 -1
  57. package/styles/tailwind-dark.css +4 -4
  58. package/styles/tailwind.css +4 -4
@@ -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';
@@ -125,6 +125,9 @@ var SearchSettings = /** @__PURE__ @class */ (function (_super) {
125
125
  __decorate$2([
126
126
  Property(true)
127
127
  ], SearchSettings.prototype, "ignoreCase", void 0);
128
+ __decorate$2([
129
+ Property(null)
130
+ ], SearchSettings.prototype, "placeholder", void 0);
128
131
  return SearchSettings;
129
132
  }(ChildProperty));
130
133
 
@@ -1016,7 +1019,13 @@ function searchWordHandler(parent, value, isLayoutChange) {
1016
1019
  }
1017
1020
  else {
1018
1021
  if (!parent.isFiltered) {
1019
- read(parent, isLayoutChange ? layoutChange : search, parent.path);
1022
+ if (parent.isSortByClicked) {
1023
+ parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
1024
+ parent.isSortByClicked = false;
1025
+ }
1026
+ else {
1027
+ read(parent, isLayoutChange ? layoutChange : search, parent.path);
1028
+ }
1020
1029
  }
1021
1030
  else {
1022
1031
  filter(parent, layoutChange);
@@ -1197,7 +1206,7 @@ function fileType(file) {
1197
1206
  function getImageUrl(parent, item) {
1198
1207
  var baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
1199
1208
  var imgUrl;
1200
- var fileName = getValue('name', item);
1209
+ var fileName = encodeURIComponent(getValue('name', item));
1201
1210
  var fPath = getValue('filterPath', item);
1202
1211
  if (parent.hasId) {
1203
1212
  var imgId = getValue('id', item);
@@ -1427,6 +1436,7 @@ function getCssClass(parent, css) {
1427
1436
  */
1428
1437
  function sortbyClickHandler(parent, args) {
1429
1438
  var tick;
1439
+ parent.isSortByClicked = true;
1430
1440
  if (args.item.id.indexOf('ascending') !== -1 || args.item.id.indexOf('descending') !== -1 || args.item.id.indexOf('none') !== -1) {
1431
1441
  tick = true;
1432
1442
  }
@@ -5783,7 +5793,7 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
5783
5793
  }
5784
5794
  };
5785
5795
  BreadCrumbBar.prototype.onSearchTextChange = function (args) {
5786
- this.searchObj.element.placeholder = getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
5796
+ this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
5787
5797
  };
5788
5798
  return BreadCrumbBar;
5789
5799
  }());
@@ -5853,16 +5863,13 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
5853
5863
  var data;
5854
5864
  var treeFolder = false;
5855
5865
  var target = args.event.target;
5856
- this.menuTarget = target;
5866
+ this.menuTarget = this.targetNodeElement = target;
5857
5867
  this.currentElement = args.element;
5858
5868
  if (target.classList.contains('e-spinner-pane')) {
5859
5869
  target = this.parent.navigationpaneModule.activeNode.getElementsByClassName(FULLROW)[0];
5860
- this.menuTarget = target;
5870
+ this.menuTarget = this.targetNodeElement = target;
5861
5871
  }
5862
- if (target.classList.contains(FULLROW)) {
5863
- this.parent.selectedItems.length = 0;
5864
- }
5865
- this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr') : target;
5872
+ this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
5866
5873
  var view = this.getTargetView(target);
5867
5874
  this.updateActiveModule();
5868
5875
  /* istanbul ignore next */
@@ -5894,7 +5901,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
5894
5901
  data = this.parent.visitedData;
5895
5902
  selected = true;
5896
5903
  }
5897
- else if (!isNullOrUndefined(closest(target, 'tr'))) {
5904
+ else if (!isNullOrUndefined(closest(target, 'tr.e-row'))) {
5898
5905
  uid = this.targetElement.getAttribute('data-uid');
5899
5906
  // eslint-disable-next-line
5900
5907
  data = this.parent.detailsviewModule.gridObj.getRowObjectFromUID(uid).data;
@@ -5971,7 +5978,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
5971
5978
  _this.enableItems(_this.disabledItems, false, true);
5972
5979
  args.cancel = menuOpenArgs.cancel;
5973
5980
  if (menuOpenArgs.cancel) {
5974
- _this.menuTarget = _this.currentElement = null;
5981
+ _this.menuTarget = _this.targetNodeElement = _this.currentElement = null;
5975
5982
  }
5976
5983
  });
5977
5984
  };
@@ -6091,7 +6098,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
6091
6098
  }
6092
6099
  else {
6093
6100
  this.parent.notify(selectedData, {});
6094
- details = this.parent.itemData;
6101
+ if (this.parent.activeModule === 'navigationpane' && itemText === 'open') {
6102
+ details = [this.menuItemData];
6103
+ }
6104
+ else {
6105
+ details = this.parent.itemData;
6106
+ }
6095
6107
  }
6096
6108
  var eventArgs = {
6097
6109
  cancel: false,
@@ -6168,6 +6180,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
6168
6180
  if (_this.parent.visitedItem) {
6169
6181
  _this.parent.notify(openInit, { target: _this.parent.visitedItem });
6170
6182
  }
6183
+ else if (_this.parent.activeModule === 'navigationpane') {
6184
+ _this.parent.navigationpaneModule.openFileOnContextMenuClick(closest(_this.targetNodeElement, 'li'));
6185
+ }
6171
6186
  break;
6172
6187
  case 'details':
6173
6188
  _this.parent.notify(detailsInit, {});
@@ -6540,6 +6555,8 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
6540
6555
  _this.folderPath = '';
6541
6556
  _this.isSameAction = false;
6542
6557
  _this.isFiltered = false;
6558
+ // Specifies whether the sort by option is clicked or not.
6559
+ _this.isSortByClicked = false;
6543
6560
  _this.enablePaste = false;
6544
6561
  _this.persistData = false;
6545
6562
  _this.retryArgs = [];
@@ -6583,6 +6600,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
6583
6600
  * @returns {void}
6584
6601
  */
6585
6602
  FileManager.prototype.preRender = function () {
6603
+ if (isNullOrUndefined(this.element.id) || this.element.id === '') {
6604
+ this.element.setAttribute('id', getUniqueID('filemanager'));
6605
+ }
6586
6606
  this.ensurePath();
6587
6607
  this.feParent = [];
6588
6608
  this.feFiles = [];
@@ -8229,6 +8249,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8229
8249
  this.isRenameParent = false;
8230
8250
  this.isRightClick = false;
8231
8251
  this.renameParent = null;
8252
+ // Specifies the previously selected nodes in the treeview control.
8253
+ this.previousSelected = null;
8254
+ // Specifies whether the nodeClicked event of the treeview control is triggered or not.
8255
+ this.isNodeClickCalled = false;
8256
+ // Specifies whether to restrict node selection in the treeview control.
8257
+ this.restrictSelecting = false;
8232
8258
  this.parent = parent;
8233
8259
  this.addEventListener();
8234
8260
  this.keyConfigs = {
@@ -8268,6 +8294,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8268
8294
  hasChildren: 'hasChild', iconCss: '_fm_icon', htmlAttributes: '_fm_htmlAttr', tooltip: 'name'
8269
8295
  },
8270
8296
  enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
8297
+ nodeSelecting: this.onNodeSelecting.bind(this),
8271
8298
  nodeSelected: this.onNodeSelected.bind(this),
8272
8299
  nodeExpanding: this.onNodeExpand.bind(this),
8273
8300
  nodeClicked: this.onNodeClicked.bind(this),
@@ -8373,6 +8400,44 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8373
8400
  this.treeObj.addNodes(directories, target, null, prevent);
8374
8401
  }
8375
8402
  };
8403
+ // Node Selecting event handler
8404
+ NavigationPane.prototype.onNodeSelecting = function (args) {
8405
+ if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
8406
+ this.restrictSelecting = false;
8407
+ this.isNodeClickCalled = false;
8408
+ return;
8409
+ }
8410
+ if (!this.renameParent) {
8411
+ this.parent.activeModule = 'navigationpane';
8412
+ // eslint-disable-next-line
8413
+ var nodeData = this.getTreeData(getValue('id', args.nodeData));
8414
+ var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8415
+ this.parent.trigger('fileOpen', eventArgs);
8416
+ args.cancel = eventArgs.cancel;
8417
+ if (args.cancel) {
8418
+ this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] != args.node.getAttribute('data-uid') : false;
8419
+ this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
8420
+ this.previousSelected = this.treeObj.selectedNodes;
8421
+ if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
8422
+ this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
8423
+ }
8424
+ }
8425
+ }
8426
+ };
8427
+ // Opens the folder while clicking open context menu item in the treeview.
8428
+ NavigationPane.prototype.openFileOnContextMenuClick = function (node) {
8429
+ var data = this.treeObj.getTreeData(node);
8430
+ // eslint-disable-next-line
8431
+ this.parent.selectedItems = [];
8432
+ this.parent.itemData = data;
8433
+ this.activeNode = node;
8434
+ this.parent.activeModule = 'navigationpane';
8435
+ updatePath(node, this.parent.itemData[0], this.parent);
8436
+ read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8437
+ this.parent.visitedItem = node;
8438
+ this.isPathDragged = this.isRenameParent = this.isRightClick = false;
8439
+ this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
8440
+ };
8376
8441
  NavigationPane.prototype.onNodeSelected = function (args) {
8377
8442
  if (this.parent.breadcrumbbarModule && this.parent.breadcrumbbarModule.searchObj && !this.renameParent) {
8378
8443
  this.parent.breadcrumbbarModule.searchObj.element.value = '';
@@ -8386,11 +8451,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8386
8451
  this.parent.activeModule = 'navigationpane';
8387
8452
  // eslint-disable-next-line
8388
8453
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
8389
- if (!this.renameParent) {
8390
- var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8391
- delete eventArgs.cancel;
8392
- this.parent.trigger('fileOpen', eventArgs);
8393
- }
8394
8454
  this.parent.selectedItems = [];
8395
8455
  this.parent.itemData = nodeData;
8396
8456
  updatePath(args.node, this.parent.itemData[0], this.parent);
@@ -8432,9 +8492,11 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8432
8492
  };
8433
8493
  NavigationPane.prototype.onNodeClicked = function (args) {
8434
8494
  this.parent.activeModule = 'navigationpane';
8495
+ this.previousSelected = this.treeObj.selectedNodes;
8435
8496
  this.activeNode = args.node;
8436
8497
  if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
8437
8498
  this.isRightClick = true;
8499
+ this.isNodeClickCalled = true;
8438
8500
  this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
8439
8501
  }
8440
8502
  else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {