@syncfusion/ej2-filemanager 27.2.2 → 27.2.5

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.2.2
3
+ * version : 27.2.5
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-filemanager@*",
3
- "_id": "@syncfusion/ej2-filemanager@27.1.55",
3
+ "_id": "@syncfusion/ej2-filemanager@27.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-mXHh/mT0JHDzdy0W7uOfch/Nh1+8YsD/66iR5ZPiWYq4meYSVdjV0KUh8nDoBsjt7bC30QoPdLK23PCpifDNjQ==",
5
+ "_integrity": "sha512-MGo4pWIt087+DhmLwvHM602yus8DIse92opOOTEPKMXp2igmvsCMQSiCWWQK9PIyt9RAMRmAx8fWSl5hezOrfw==",
6
6
  "_location": "/@syncfusion/ej2-filemanager",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-richtexteditor",
25
25
  "/@syncfusion/ej2-vue-filemanager"
26
26
  ],
27
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-filemanager/-/ej2-filemanager-27.1.55.tgz",
28
- "_shasum": "f115703417214ffe376fda5ff562fa5db915eb6b",
27
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-filemanager/-/ej2-filemanager-27.2.3.tgz",
28
+ "_shasum": "d3c2b67dab2a63cfb4c725588a764145472bcc4d",
29
29
  "_spec": "@syncfusion/ej2-filemanager@*",
30
30
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
31
31
  "author": {
@@ -36,14 +36,14 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~27.2.2",
40
- "@syncfusion/ej2-buttons": "~27.2.2",
39
+ "@syncfusion/ej2-base": "~27.2.5",
40
+ "@syncfusion/ej2-buttons": "~27.2.4",
41
41
  "@syncfusion/ej2-data": "~27.2.2",
42
- "@syncfusion/ej2-grids": "~27.2.2",
43
- "@syncfusion/ej2-inputs": "~27.2.2",
44
- "@syncfusion/ej2-layouts": "~27.2.2",
45
- "@syncfusion/ej2-lists": "~27.2.2",
46
- "@syncfusion/ej2-navigations": "~27.2.2",
42
+ "@syncfusion/ej2-grids": "~27.2.5",
43
+ "@syncfusion/ej2-inputs": "~27.2.4",
44
+ "@syncfusion/ej2-layouts": "~27.2.3",
45
+ "@syncfusion/ej2-lists": "~27.2.5",
46
+ "@syncfusion/ej2-navigations": "~27.2.5",
47
47
  "@syncfusion/ej2-popups": "~27.2.2",
48
48
  "@syncfusion/ej2-splitbuttons": "~27.2.2"
49
49
  },
@@ -75,6 +75,6 @@
75
75
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
76
76
  },
77
77
  "typings": "index.d.ts",
78
- "version": "27.2.2",
78
+ "version": "27.2.5",
79
79
  "sideEffects": false
80
80
  }
@@ -929,6 +929,7 @@ export interface ITreeView extends Component<HTMLElement> {
929
929
  rootID: string;
930
930
  activeNode: Element;
931
931
  openFileOnContextMenuClick: Function;
932
+ previousSelected: string[];
932
933
  }
933
934
  /** @hidden */
934
935
  export interface IContextMenu extends Component<HTMLElement> {
@@ -188,7 +188,9 @@ function isFileExists(fileSystemData, name) {
188
188
  * @private
189
189
  */
190
190
  function findIndexById(parent, id) {
191
- var index = parent.fileSystemData.findIndex(function (item) { return String(item.id) === String(id); });
191
+ var index = parent.fileSystemData.findIndex(function (item) {
192
+ return !isNOU(item) && String(item.id) === String(id);
193
+ });
192
194
  return index;
193
195
  }
194
196
  /**
@@ -562,9 +564,10 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
562
564
  if (!beforeSendArgs.cancel) {
563
565
  parent.notify(events.beforeRequest, {});
564
566
  if (isFileSystemData(parent)) {
565
- var filePath = event === 'node-expand' || event === 'finalize-end' ? getValue('path', data) : parent.path;
567
+ var filePath = event === 'node-expand' || event === 'finalize-end' || event === 'rename-end-parent'
568
+ ? getValue('path', data) : parent.path;
566
569
  var pathArray = filePath.replace(/^\/|\/$/g, '').split('/');
567
- var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length !== 0)
570
+ var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length !== 0 && isNOU(parent.renamedItem))
568
571
  || (event === 'paste-end' && (parent.targetModule === 'largeiconsview' || parent.targetModule === 'detailsview'))
569
572
  ? getValue('data', data)[0].id : pathArray[pathArray.length - 1];
570
573
  var action = getValue('action', data);
@@ -590,7 +593,12 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
590
593
  else if (isFileOperation && parent.responseData.error === null) {
591
594
  var itemData = action === 'search' || action === 'delete' ? getValue('data', data) : [];
592
595
  if (itemData.length === 0) {
593
- itemData = getValue('data', data).map(function (item) { return filterById(parent, item.id); });
596
+ if (action === 'copy') {
597
+ itemData = parent.pasteNodes.map(function (item) { return filterById(parent, item); });
598
+ }
599
+ else {
600
+ itemData = getValue('data', data).map(function (item) { return filterById(parent, item.id); });
601
+ }
594
602
  }
595
603
  parent.responseData = {
596
604
  cwd: null,
@@ -950,14 +958,21 @@ function renameSuccess(parent, result) {
950
958
  };
951
959
  parent.trigger('rename', renameEventArgs);
952
960
  if (parent.activeModule === 'navigationpane') {
961
+ var pathObject = getPathObject(parent);
962
+ var pathLevel = parent.pathId[parent.pathId.length - 1].split('_').length - 2;
953
963
  parent.pathId.pop();
954
964
  parent.itemData = [getValue(parent.pathId[parent.pathId.length - 1], parent.feParent)];
955
965
  read(parent, events.renameEndParent, getValue('filterPath', parent.renamedItem).replace(/\\/g, '/'));
956
- parent.itemData[0] = parent.renamedItem;
957
- if (getValue('filterPath', parent.renamedItem) === getValue('filterPath', parent.itemData[0]) && parent.pathNames.length > 1) {
958
- parent.pathNames[parent.pathNames.length - 1] = parent.renameText;
966
+ if (!isNOU(pathObject) && parent.pathNames.length > 1 && pathLevel <= parent.pathNames.length - 1) {
967
+ parent.pathNames[pathLevel] = parent.renameText;
968
+ if (!parent.hasId) {
969
+ parent.setProperties({ path: "/" + parent.pathNames.slice(1).join('/') + "/" }, true);
970
+ }
959
971
  }
960
- read(parent, events.pathChanged, parent.path === '/' ? parent.path : getValue('filterPath', parent.renamedItem).replace(/\\/g, '/') + parent.renamedItem.name + '/');
972
+ parent.itemData = parent.navigationpaneModule.previousSelected.length > 0
973
+ ? parent.navigationpaneModule.treeObj.getTreeData(parent.navigationpaneModule.previousSelected[0]) : parent.itemData;
974
+ read(parent, events.pathChanged, parent.path);
975
+ parent.itemData[0] = parent.renamedItem;
961
976
  parent.renamedItem = null;
962
977
  }
963
978
  else {
@@ -110,6 +110,17 @@ export declare function removeBlur(parent?: IFileManager, hover?: string): void;
110
110
  * @private
111
111
  */
112
112
  export declare function getModule(parent: IFileManager, element: Element): void;
113
+ /**
114
+ * Get all child items
115
+ *
116
+ * @param {IFileManager} parent - specifies the parent element.
117
+ * @param {string | number} parentId - specifies the parent ID.
118
+ * @returns {Object[]} An array of child items
119
+ * @private
120
+ */
121
+ export declare function getAllChildItems(parent: IFileManager, parentId: number | string): {
122
+ [key: string]: Object;
123
+ }[];
113
124
  /**
114
125
  * Gets module name
115
126
  *
@@ -270,6 +270,25 @@ export function getModule(parent, element) {
270
270
  }
271
271
  }
272
272
  }
273
+ /**
274
+ * Get all child items
275
+ *
276
+ * @param {IFileManager} parent - specifies the parent element.
277
+ * @param {string | number} parentId - specifies the parent ID.
278
+ * @returns {Object[]} An array of child items
279
+ * @private
280
+ */
281
+ export function getAllChildItems(parent, parentId) {
282
+ var children = parent.fileSystemData.filter(function (item) {
283
+ return String(item.parentId) === String(parentId);
284
+ });
285
+ var allChildren = children.slice();
286
+ children.forEach(function (child) {
287
+ var childId = child.id;
288
+ allChildren = allChildren.concat(getAllChildItems(parent, childId));
289
+ });
290
+ return allChildren;
291
+ }
273
292
  /**
274
293
  * Gets module name
275
294
  *
@@ -291,7 +310,9 @@ export function searchWordHandler(parent, value, isLayoutChange) {
291
310
  }
292
311
  else {
293
312
  parent.searchSettings.filterType = isNOU(parent.searchSettings.filterType) ? 'contains' : parent.searchSettings.filterType;
294
- var filteredData = parent.fileSystemData.filter(function (obj) { return obj.parentId !== null; });
313
+ var currData = getValue(parent.pathId[parent.pathId.length - 1], parent.feParent);
314
+ var parentId = getValue('id', currData);
315
+ var filteredData = getAllChildItems(parent, parentId);
295
316
  var data = new DataManager(filteredData).
296
317
  executeLocal(new Query().where('name', parent.searchSettings.filterType, value, parent.searchSettings.ignoreCase));
297
318
  var searchValue = parent.searchSettings.ignoreCase ? value.toLowerCase() : value;
@@ -1057,6 +1078,7 @@ export function doPasteUpdate(parent, operation, result) {
1057
1078
  else {
1058
1079
  parent.isDropEnd = false;
1059
1080
  }
1081
+ parent.trigger('success', { action: operation, result: result });
1060
1082
  if (!parent.isDragDrop || (parent.path === parent.dragPath) || (parent.path === parent.dropPath)
1061
1083
  || parent.isSearchDrag) {
1062
1084
  parent.isPathDrag = false;
@@ -1065,7 +1087,6 @@ export function doPasteUpdate(parent, operation, result) {
1065
1087
  else {
1066
1088
  readDropPath(parent);
1067
1089
  }
1068
- parent.trigger('success', { action: operation, result: result });
1069
1090
  }
1070
1091
  /**
1071
1092
  * Reads the drop path
@@ -408,7 +408,7 @@ var DetailsView = /** @class */ (function () {
408
408
  this.element.querySelector('.e-content').scrollTop === 0))) {
409
409
  this.selectRecords(this.parent.selectedItems);
410
410
  }
411
- if (this.isPasteOperation === true) {
411
+ if (this.isPasteOperation === true && (!isNullOrUndefined(this.gridObj.getDataRows()) && this.gridObj.getDataRows().length > 0)) {
412
412
  if (!this.isColumnRefresh) {
413
413
  this.selectRecords(this.parent.pasteNodes);
414
414
  this.isPasteOperation = false;
@@ -412,7 +412,7 @@ var LargeIconsView = /** @class */ (function () {
412
412
  removeBlur(this.parent);
413
413
  this.parent.setProperties({ selectedItems: [] }, true);
414
414
  this.onLayoutChange(args);
415
- if (this.parent.renamedItem) {
415
+ if (this.parent.renamedItem && this.parent.activeModule === 'largeiconsview') {
416
416
  this.clearSelect();
417
417
  this.addSelection(this.parent.renamedItem);
418
418
  }
@@ -14,6 +14,7 @@ export declare class NavigationPane {
14
14
  removeNodes: string[];
15
15
  moveNames: string[];
16
16
  touchClickObj: Touch;
17
+ previousSelected: string[];
17
18
  private expandTree;
18
19
  private isDrag;
19
20
  private dragObj;
@@ -23,7 +24,6 @@ export declare class NavigationPane {
23
24
  private isSameNodeClicked;
24
25
  private isNodeExpandCalled;
25
26
  private renameParent;
26
- private previousSelected;
27
27
  private isNodeClickCalled;
28
28
  private restrictSelecting;
29
29
  /**
@@ -24,6 +24,8 @@ var NavigationPane = /** @class */ (function () {
24
24
  function NavigationPane(parent) {
25
25
  this.removeNodes = [];
26
26
  this.moveNames = [];
27
+ // Specifies the previously selected nodes in the treeview control.
28
+ this.previousSelected = [];
27
29
  this.expandTree = false;
28
30
  this.isDrag = false;
29
31
  this.isPathDragged = false;
@@ -32,8 +34,6 @@ var NavigationPane = /** @class */ (function () {
32
34
  this.isSameNodeClicked = false;
33
35
  this.isNodeExpandCalled = false;
34
36
  this.renameParent = null;
35
- // Specifies the previously selected nodes in the treeview control.
36
- this.previousSelected = null;
37
37
  // Specifies whether the nodeClicked event of the treeview control is triggered or not.
38
38
  this.isNodeClickCalled = false;
39
39
  // Specifies whether to restrict node selection in the treeview control.
@@ -212,7 +212,7 @@ var NavigationPane = /** @class */ (function () {
212
212
  this.isNodeClickCalled = true;
213
213
  this.isSameNodeClicked = false;
214
214
  this.previousSelected = this.treeObj.selectedNodes;
215
- this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
215
+ this.treeObj.setProperties({ selectedNodes: [args.node.getAttribute('data-uid')] });
216
216
  }
217
217
  }
218
218
  else if (this.previousSelected[0] !== args.node.getAttribute('data-uid')) {
@@ -236,7 +236,7 @@ var NavigationPane = /** @class */ (function () {
236
236
  read(this.parent, this.isPathDragged ? events.pasteEnd : events.pathChanged, this.parent.path);
237
237
  this.parent.visitedItem = node;
238
238
  this.isPathDragged = this.isRenameParent = this.isRightClick = false;
239
- this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
239
+ this.treeObj.setProperties({ selectedNodes: [node.getAttribute('data-uid')] });
240
240
  }
241
241
  };
242
242
  NavigationPane.prototype.onNodeSelected = function (args) {
@@ -312,7 +312,7 @@ var NavigationPane = /** @class */ (function () {
312
312
  if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
313
313
  this.isRightClick = true;
314
314
  this.isNodeClickCalled = true;
315
- this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
315
+ this.treeObj.setProperties({ selectedNodes: [args.node.getAttribute('data-uid')] });
316
316
  }
317
317
  else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {
318
318
  this.parent.setProperties({ selectedItems: [] }, true);
@@ -325,7 +325,7 @@ var NavigationPane = /** @class */ (function () {
325
325
  }
326
326
  this.isSameNodeClicked = true;
327
327
  this.isNodeClickCalled = true;
328
- this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
328
+ this.treeObj.setProperties({ selectedNodes: [args.node.getAttribute('data-uid')] });
329
329
  }
330
330
  };
331
331
  /* istanbul ignore next */
@@ -375,7 +375,7 @@ var NavigationPane = /** @class */ (function () {
375
375
  NavigationPane.prototype.onOpenEnd = function (args) {
376
376
  var sleId = this.parent.pathId[this.parent.pathId.length - 1];
377
377
  this.treeObj.expandAll(this.treeObj.selectedNodes);
378
- this.treeObj.selectedNodes = [sleId];
378
+ this.treeObj.setProperties({ selectedNodes: [sleId] });
379
379
  this.expandNodeTarget = 'add';
380
380
  this.onPathChanged(args);
381
381
  };
@@ -394,7 +394,7 @@ var NavigationPane = /** @class */ (function () {
394
394
  this.onInit();
395
395
  var id = getValue('_fm_id', args.cwd);
396
396
  this.addChild(args.files, id, false);
397
- this.treeObj.selectedNodes = [this.parent.pathId[this.parent.pathId.length - 1]];
397
+ this.treeObj.setProperties({ selectedNodes: [this.parent.pathId[this.parent.pathId.length - 1]] });
398
398
  };
399
399
  NavigationPane.prototype.onCreateEnd = function (args) {
400
400
  this.updateTree(args);
@@ -454,9 +454,11 @@ var NavigationPane = /** @class */ (function () {
454
454
  }
455
455
  }
456
456
  if (resultData.length > 0) {
457
- var id_1 = getValue(this.treeObj.fields.id, resultData[0]);
457
+ var id_1 = this.previousSelected.length > 0 && this.treeObj.getTreeData(this.previousSelected[0]).length !== 0
458
+ ? this.previousSelected[0] : getValue(this.treeObj.fields.id, resultData[0]);
458
459
  this.treeObj.selectedNodes = [id_1];
459
460
  this.treeObj.dataBind();
461
+ this.updateItemData();
460
462
  }
461
463
  }
462
464
  };
@@ -513,7 +515,7 @@ var NavigationPane = /** @class */ (function () {
513
515
  this.doDownload();
514
516
  };
515
517
  NavigationPane.prototype.onSelectionChanged = function (e) {
516
- this.treeObj.selectedNodes = [e.selectedNode];
518
+ this.treeObj.setProperties({ selectedNodes: [e.selectedNode] });
517
519
  };
518
520
  NavigationPane.prototype.onClearPathInit = function (e) {
519
521
  this.removeChildNodes(e.selectedNode);
@@ -855,6 +857,8 @@ var NavigationPane = /** @class */ (function () {
855
857
  };
856
858
  NavigationPane.prototype.updateActionData = function () {
857
859
  this.updateItemData();
860
+ var node = select('[data-uid="' + this.parent.pathId[this.parent.pathId.length - 1] + '"]', this.treeObj.element);
861
+ updatePath(node, this.parent.itemData[0], this.parent);
858
862
  var newPath = getParentPath(this.parent.path);
859
863
  this.parent.setProperties({ path: newPath }, true);
860
864
  this.parent.pathId.pop();
@@ -92,7 +92,7 @@ var ContextMenu = /** @class */ (function () {
92
92
  }
93
93
  }
94
94
  this.parent.pathId.push(parentKey[parentKey.length - 1]);
95
- this.parent.navigationpaneModule.treeObj.selectedNodes = [this.parent.pathId[this.parent.pathId.length - 1]];
95
+ this.parent.navigationpaneModule.treeObj.setProperties({ selectedNodes: [this.parent.pathId[this.parent.pathId.length - 1]] });
96
96
  }
97
97
  this.isMenuItemClicked = false;
98
98
  };
@@ -154,7 +154,7 @@ var ContextMenu = /** @class */ (function () {
154
154
  else if (closest(target, '#' + this.parent.element.id + CLS.TREE_ID)) {
155
155
  uid = closest(target, 'li').getAttribute('data-uid');
156
156
  if (!isNOU(uid)) {
157
- this.parent.navigationpaneModule.treeObj.selectedNodes = [uid];
157
+ this.parent.navigationpaneModule.treeObj.setProperties({ selectedNodes: [uid] });
158
158
  }
159
159
  treeFolder = true;
160
160
  }