@syncfusion/ej2-filemanager 19.4.56 → 20.1.52-10459

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 (208) hide show
  1. package/.eslintrc.json +20 -3
  2. package/README.md +54 -43
  3. package/dist/ej2-filemanager.min.js +1 -0
  4. package/dist/ej2-filemanager.umd.min.js +1 -10
  5. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-filemanager.es2015.js +2371 -664
  7. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  8. package/dist/es6/ej2-filemanager.es5.js +2440 -714
  9. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  10. package/dist/global/ej2-filemanager.min.js +1 -10
  11. package/dist/global/ej2-filemanager.min.js.map +1 -1
  12. package/dist/global/index.d.ts +0 -9
  13. package/helpers/e2e/filemanagerHelper.js +183 -166
  14. package/package.json +71 -71
  15. package/src/file-manager/actions/breadcrumb-bar.js +1 -5
  16. package/src/file-manager/actions/index.d.ts +1 -0
  17. package/src/file-manager/actions/index.js +1 -0
  18. package/src/file-manager/actions/toolbar.d.ts +1 -0
  19. package/src/file-manager/actions/toolbar.js +135 -20
  20. package/src/file-manager/actions/virtualization.d.ts +93 -0
  21. package/src/file-manager/actions/virtualization.js +279 -0
  22. package/src/file-manager/base/file-manager-model.d.ts +161 -28
  23. package/src/file-manager/base/file-manager.d.ts +182 -28
  24. package/src/file-manager/base/file-manager.js +254 -29
  25. package/src/file-manager/base/interface.d.ts +329 -3
  26. package/src/file-manager/base/interface.js +0 -1
  27. package/src/file-manager/common/operations.d.ts +7 -0
  28. package/src/file-manager/common/operations.js +830 -185
  29. package/src/file-manager/common/utility.d.ts +46 -3
  30. package/src/file-manager/common/utility.js +249 -73
  31. package/src/file-manager/index.d.ts +1 -0
  32. package/src/file-manager/index.js +1 -0
  33. package/src/file-manager/layout/details-view.d.ts +10 -0
  34. package/src/file-manager/layout/details-view.js +204 -94
  35. package/src/file-manager/layout/large-icons-view.d.ts +4 -2
  36. package/src/file-manager/layout/large-icons-view.js +122 -73
  37. package/src/file-manager/layout/navigation-pane.d.ts +2 -0
  38. package/src/file-manager/layout/navigation-pane.js +97 -73
  39. package/src/file-manager/models/column-model.d.ts +23 -5
  40. package/src/file-manager/models/column.d.ts +21 -2
  41. package/src/file-manager/models/column.js +6 -0
  42. package/src/file-manager/models/default-locale.js +0 -1
  43. package/src/file-manager/models/details-view-settings-model.d.ts +1 -1
  44. package/src/file-manager/models/details-view-settings.js +8 -3
  45. package/src/file-manager/models/navigation-pane-settings.d.ts +8 -8
  46. package/src/file-manager/models/search-settings.d.ts +5 -0
  47. package/src/file-manager/models/toolbar-settings-model.d.ts +177 -2
  48. package/src/file-manager/models/toolbar-settings.d.ts +157 -2
  49. package/src/file-manager/models/toolbar-settings.js +64 -2
  50. package/src/file-manager/models/upload-settings-model.d.ts +13 -0
  51. package/src/file-manager/models/upload-settings.d.ts +12 -0
  52. package/src/file-manager/models/upload-settings.js +3 -0
  53. package/src/file-manager/pop-up/context-menu.d.ts +2 -1
  54. package/src/file-manager/pop-up/context-menu.js +111 -36
  55. package/src/file-manager/pop-up/dialog.d.ts +1 -2
  56. package/src/file-manager/pop-up/dialog.js +19 -40
  57. package/src/global.js +1 -1
  58. package/styles/bootstrap-dark-lite.css +1058 -0
  59. package/styles/bootstrap-dark-lite.scss +16 -0
  60. package/styles/bootstrap-dark.css +371 -665
  61. package/styles/bootstrap-dark.scss +17 -1
  62. package/styles/bootstrap-lite.css +1040 -0
  63. package/styles/bootstrap-lite.scss +16 -0
  64. package/styles/bootstrap.css +353 -644
  65. package/styles/bootstrap.scss +17 -1
  66. package/styles/bootstrap4-lite.css +1068 -0
  67. package/styles/bootstrap4-lite.scss +16 -0
  68. package/styles/bootstrap4.css +381 -680
  69. package/styles/bootstrap4.scss +17 -1
  70. package/styles/bootstrap5-dark-lite.css +1078 -0
  71. package/styles/bootstrap5-dark-lite.scss +16 -0
  72. package/styles/bootstrap5-dark.css +377 -695
  73. package/styles/bootstrap5-dark.scss +17 -1
  74. package/styles/bootstrap5-lite.css +1078 -0
  75. package/styles/bootstrap5-lite.scss +16 -0
  76. package/styles/bootstrap5.3-lite.css +1035 -0
  77. package/styles/bootstrap5.3-lite.scss +16 -0
  78. package/styles/bootstrap5.3.css +1603 -0
  79. package/styles/bootstrap5.3.scss +17 -0
  80. package/styles/bootstrap5.css +377 -695
  81. package/styles/bootstrap5.scss +17 -1
  82. package/styles/fabric-dark-lite.css +1039 -0
  83. package/styles/fabric-dark-lite.scss +16 -0
  84. package/styles/fabric-dark.css +358 -642
  85. package/styles/fabric-dark.scss +17 -1
  86. package/styles/fabric-lite.css +1039 -0
  87. package/styles/fabric-lite.scss +16 -0
  88. package/styles/fabric.css +357 -641
  89. package/styles/fabric.scss +17 -1
  90. package/styles/file-manager/_all.scss +1 -1
  91. package/styles/file-manager/_bds-definition.scss +236 -0
  92. package/styles/file-manager/_bigger.scss +758 -0
  93. package/styles/file-manager/_bootstrap-dark-definition.scss +6 -2
  94. package/styles/file-manager/_bootstrap-definition.scss +6 -2
  95. package/styles/file-manager/_bootstrap4-definition.scss +6 -2
  96. package/styles/file-manager/_bootstrap5-definition.scss +21 -16
  97. package/styles/file-manager/_bootstrap5.3-definition.scss +242 -0
  98. package/styles/file-manager/_fabric-dark-definition.scss +6 -2
  99. package/styles/file-manager/_fabric-definition.scss +6 -2
  100. package/styles/file-manager/_fluent-dark-definition.scss +1 -0
  101. package/styles/file-manager/_fluent-definition.scss +26 -22
  102. package/styles/file-manager/_fluent2-definition.scss +255 -0
  103. package/styles/file-manager/_fusionnew-definition.scss +241 -0
  104. package/styles/file-manager/_highcontrast-definition.scss +6 -2
  105. package/styles/file-manager/_highcontrast-light-definition.scss +6 -2
  106. package/styles/file-manager/_layout.scss +373 -912
  107. package/styles/file-manager/_material-dark-definition.scss +7 -2
  108. package/styles/file-manager/_material-definition.scss +7 -2
  109. package/styles/file-manager/_material3-dark-definition.scss +1 -0
  110. package/styles/file-manager/_material3-definition.scss +235 -0
  111. package/styles/file-manager/_tailwind-definition.scss +20 -16
  112. package/styles/file-manager/_theme.scss +130 -99
  113. package/styles/file-manager/bootstrap-dark.css +371 -665
  114. package/styles/file-manager/bootstrap-dark.scss +2 -1
  115. package/styles/file-manager/bootstrap.css +353 -644
  116. package/styles/file-manager/bootstrap.scss +2 -1
  117. package/styles/file-manager/bootstrap4.css +381 -680
  118. package/styles/file-manager/bootstrap4.scss +2 -1
  119. package/styles/file-manager/bootstrap5-dark.css +377 -695
  120. package/styles/file-manager/bootstrap5-dark.scss +2 -1
  121. package/styles/file-manager/bootstrap5.3.css +1603 -0
  122. package/styles/file-manager/bootstrap5.3.scss +17 -0
  123. package/styles/file-manager/bootstrap5.css +377 -695
  124. package/styles/file-manager/bootstrap5.scss +2 -1
  125. package/styles/file-manager/fabric-dark.css +358 -642
  126. package/styles/file-manager/fabric-dark.scss +2 -1
  127. package/styles/file-manager/fabric.css +357 -641
  128. package/styles/file-manager/fabric.scss +2 -1
  129. package/styles/file-manager/fluent-dark.css +1616 -0
  130. package/styles/file-manager/fluent-dark.scss +17 -0
  131. package/styles/file-manager/fluent.css +1615 -0
  132. package/styles/file-manager/fluent.scss +17 -0
  133. package/styles/file-manager/fluent2.css +1886 -0
  134. package/styles/file-manager/fluent2.scss +17 -0
  135. package/styles/file-manager/highcontrast-light.css +354 -644
  136. package/styles/file-manager/highcontrast-light.scss +2 -1
  137. package/styles/file-manager/highcontrast.css +377 -647
  138. package/styles/file-manager/highcontrast.scss +2 -1
  139. package/styles/file-manager/icons/_bds.scss +235 -0
  140. package/styles/file-manager/icons/_bootstrap.scss +0 -1
  141. package/styles/file-manager/icons/_bootstrap4.scss +0 -1
  142. package/styles/file-manager/icons/_bootstrap5.3.scss +235 -0
  143. package/styles/file-manager/icons/_fabric-dark.scss +0 -1
  144. package/styles/file-manager/icons/_fabric.scss +0 -1
  145. package/styles/file-manager/icons/_fluent-dark.scss +1 -0
  146. package/styles/file-manager/icons/_fluent.scss +19 -19
  147. package/styles/file-manager/icons/_fluent2.scss +235 -0
  148. package/styles/file-manager/icons/_fusionnew.scss +235 -0
  149. package/styles/file-manager/icons/_material3-dark.scss +1 -0
  150. package/styles/file-manager/icons/_material3.scss +235 -0
  151. package/styles/file-manager/icons/_tailwind.scss +49 -49
  152. package/styles/file-manager/material-dark.css +392 -671
  153. package/styles/file-manager/material-dark.scss +2 -1
  154. package/styles/file-manager/material.css +391 -654
  155. package/styles/file-manager/material.scss +2 -1
  156. package/styles/file-manager/material3-dark.css +1633 -0
  157. package/styles/file-manager/material3-dark.scss +18 -0
  158. package/styles/file-manager/material3.css +1635 -0
  159. package/styles/file-manager/material3.scss +18 -0
  160. package/styles/file-manager/tailwind-dark.css +369 -686
  161. package/styles/file-manager/tailwind-dark.scss +2 -1
  162. package/styles/file-manager/tailwind.css +369 -686
  163. package/styles/file-manager/tailwind.scss +2 -1
  164. package/styles/fluent-dark-lite.css +1037 -0
  165. package/styles/fluent-dark-lite.scss +16 -0
  166. package/styles/fluent-dark.css +1616 -0
  167. package/styles/fluent-dark.scss +17 -0
  168. package/styles/fluent-lite.css +1036 -0
  169. package/styles/fluent-lite.scss +16 -0
  170. package/styles/fluent.css +1615 -0
  171. package/styles/fluent.scss +17 -0
  172. package/styles/fluent2-lite.css +1272 -0
  173. package/styles/fluent2-lite.scss +16 -0
  174. package/styles/fluent2.css +1886 -0
  175. package/styles/fluent2.scss +17 -0
  176. package/styles/highcontrast-light-lite.css +1039 -0
  177. package/styles/highcontrast-light-lite.scss +16 -0
  178. package/styles/highcontrast-light.css +354 -644
  179. package/styles/highcontrast-light.scss +17 -1
  180. package/styles/highcontrast-lite.css +1059 -0
  181. package/styles/highcontrast-lite.scss +16 -0
  182. package/styles/highcontrast.css +377 -647
  183. package/styles/highcontrast.scss +17 -1
  184. package/styles/material-dark-lite.css +1092 -0
  185. package/styles/material-dark-lite.scss +16 -0
  186. package/styles/material-dark.css +392 -671
  187. package/styles/material-dark.scss +17 -1
  188. package/styles/material-lite.css +1097 -0
  189. package/styles/material-lite.scss +16 -0
  190. package/styles/material.css +391 -654
  191. package/styles/material.scss +17 -1
  192. package/styles/material3-dark-lite.css +1090 -0
  193. package/styles/material3-dark-lite.scss +16 -0
  194. package/styles/material3-dark.css +1633 -0
  195. package/styles/material3-dark.scss +19 -0
  196. package/styles/material3-lite.css +1092 -0
  197. package/styles/material3-lite.scss +16 -0
  198. package/styles/material3.css +1635 -0
  199. package/styles/material3.scss +19 -0
  200. package/styles/tailwind-dark-lite.css +1060 -0
  201. package/styles/tailwind-dark-lite.scss +16 -0
  202. package/styles/tailwind-dark.css +369 -686
  203. package/styles/tailwind-dark.scss +17 -1
  204. package/styles/tailwind-lite.css +1060 -0
  205. package/styles/tailwind-lite.scss +16 -0
  206. package/styles/tailwind.css +369 -686
  207. package/styles/tailwind.scss +17 -1
  208. package/CHANGELOG.md +0 -466
@@ -4,10 +4,10 @@ import { KeyboardEvents, closest } from '@syncfusion/ej2-base';
4
4
  import { DataManager, Query } from '@syncfusion/ej2-data';
5
5
  import * as events from '../base/constant';
6
6
  import * as CLS from '../base/classes';
7
- import { read, Download, GetDetails, Delete } from '../common/operations';
7
+ import { read, Download, GetDetails, Delete, isFileSystemData } from '../common/operations';
8
8
  import { createDialog } from '../pop-up/dialog';
9
9
  import { updatePath, getPath, getDirectories } from '../common/utility';
10
- import { createVirtualDragElement, dragStopHandler, dragStartHandler, draggingHandler, getDirectoryPath, getModule } from '../common/index';
10
+ import { createVirtualDragElement, dragStopHandler, dragStartHandler, draggingHandler, getDirectoryPath, getModule, getPathId } from '../common/index';
11
11
  import { copyFiles, cutFiles, removeActive, pasteHandler, getParentPath, readDropPath } from '../common/index';
12
12
  import { hasEditAccess, createDeniedDialog, hasDownloadAccess, getAccessClass } from '../common/index';
13
13
  /**
@@ -20,6 +20,7 @@ var NavigationPane = /** @class */ (function () {
20
20
  * @param {IFileManager} parent - specifies the parent element.
21
21
  * @hidden
22
22
  */
23
+ /* istanbul ignore next */
23
24
  function NavigationPane(parent) {
24
25
  this.removeNodes = [];
25
26
  this.moveNames = [];
@@ -28,6 +29,8 @@ var NavigationPane = /** @class */ (function () {
28
29
  this.isPathDragged = false;
29
30
  this.isRenameParent = false;
30
31
  this.isRightClick = false;
32
+ this.isSameNodeClicked = false;
33
+ this.isNodeExpandCalled = false;
31
34
  this.renameParent = null;
32
35
  // Specifies the previously selected nodes in the treeview control.
33
36
  this.previousSelected = null;
@@ -41,9 +44,9 @@ var NavigationPane = /** @class */ (function () {
41
44
  altEnter: 'alt+enter',
42
45
  esc: 'escape',
43
46
  del: 'delete',
44
- ctrlX: 'ctrl+x',
45
- ctrlC: 'ctrl+c',
46
- ctrlV: 'ctrl+v',
47
+ ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
48
+ ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
49
+ ctrlV: this.parent.isMac ? 'cmd+v' : 'ctrl+v',
47
50
  ctrlShiftN: 'ctrl+shift+n',
48
51
  shiftF10: 'shift+F10',
49
52
  f2: 'f2'
@@ -53,10 +56,8 @@ var NavigationPane = /** @class */ (function () {
53
56
  if (!isNOU(this.treeObj)) {
54
57
  return;
55
58
  }
56
- // eslint-disable-next-line
57
59
  var rootData = getValue(this.parent.pathId[0], this.parent.feParent);
58
60
  setValue('_fm_icon', 'e-fe-folder', rootData);
59
- // eslint-disable-next-line
60
61
  var attr = {};
61
62
  var id = getValue('id', rootData);
62
63
  if (!isNOU(id)) {
@@ -92,10 +93,7 @@ var NavigationPane = /** @class */ (function () {
92
93
  NavigationPane.prototype.addDragDrop = function () {
93
94
  var _this = this;
94
95
  if (!this.parent.isMobile && this.treeObj) {
95
- if (this.parent.allowDragAndDrop) {
96
- if (this.dragObj) {
97
- this.dragObj.destroy();
98
- }
96
+ if (this.parent.allowDragAndDrop && isNOU(this.dragObj)) {
99
97
  this.dragObj = new Draggable(this.treeObj.element, {
100
98
  cursorAt: this.parent.dragCursorPosition,
101
99
  dragTarget: '.' + CLS.FULLROW,
@@ -107,12 +105,13 @@ var NavigationPane = /** @class */ (function () {
107
105
  },
108
106
  dragStop: dragStopHandler.bind(this, this.parent),
109
107
  enableTailMode: true,
110
- enableAutoScroll: true,
108
+ enableAutoScroll: false,
111
109
  helper: this.dragHelper.bind(this)
112
110
  });
113
111
  }
114
112
  else if (!this.parent.allowDragAndDrop && this.dragObj) {
115
113
  this.dragObj.destroy();
114
+ this.dragObj = null;
116
115
  }
117
116
  }
118
117
  };
@@ -128,7 +127,6 @@ var NavigationPane = /** @class */ (function () {
128
127
  this.parent.activeElements = [dragLi];
129
128
  this.parent.dragNodes = [];
130
129
  getModule(this.parent, dragLi);
131
- // eslint-disable-next-line
132
130
  this.parent.dragData = this.getTreeData(dragLi);
133
131
  this.parent.dragPath = this.getDragPath(dragLi, this.parent.dragData[0].name);
134
132
  this.parent.dragNodes.push(this.parent.dragData[0].name);
@@ -152,18 +150,20 @@ var NavigationPane = /** @class */ (function () {
152
150
  };
153
151
  this.parent.trigger('fileLoad', eventArgs);
154
152
  };
155
- // eslint-disable-next-line
156
153
  NavigationPane.prototype.addChild = function (files, target, prevent) {
157
- // eslint-disable-next-line
158
154
  var directories = getDirectories(files);
159
- if (directories.length > 0) {
155
+ var targetDirectory = this.getTreeData(target);
156
+ if (directories.length > 0 && targetDirectory.length > 0 &&
157
+ (directories[0].filterPath == null ||
158
+ isNOU(targetDirectory[0])
159
+ && targetDirectory[0].filterPath == null
160
+ || directories[0].filterPath !==
161
+ targetDirectory[0].filterPath)) {
160
162
  var length_1 = 0;
161
- // eslint-disable-next-line
162
163
  var folders = directories;
163
164
  while (length_1 < directories.length) {
164
- // eslint-disable-next-line
165
- folders[length_1]._fm_icon = 'e-fe-folder';
166
- // eslint-disable-next-line
165
+ // eslint-disable-next-line camelcase
166
+ folders[parseInt(length_1.toString(), 10)]._fm_icon = 'e-fe-folder';
167
167
  var attr = {};
168
168
  var id = getValue('id', folders[length_1]);
169
169
  if (!isNOU(id)) {
@@ -177,77 +177,105 @@ var NavigationPane = /** @class */ (function () {
177
177
  }
178
178
  length_1++;
179
179
  }
180
- // eslint-disable-next-line
181
- this.treeObj.addNodes(directories, target, null, prevent);
180
+ var element = select('[data-uid="' + target + '"]', this.treeObj.element);
181
+ var childElements = select('ul', element);
182
+ if (isNOU(childElements)) {
183
+ this.treeObj.addNodes(directories, target, null, prevent);
184
+ }
182
185
  }
183
186
  };
184
187
  // Node Selecting event handler
185
188
  NavigationPane.prototype.onNodeSelecting = function (args) {
186
- if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
189
+ if (!args.isInteracted && !this.isRightClick &&
190
+ !this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
187
191
  this.restrictSelecting = false;
188
192
  this.isNodeClickCalled = false;
189
193
  return;
190
194
  }
191
195
  if (!this.renameParent) {
192
196
  this.parent.activeModule = 'navigationpane';
193
- // eslint-disable-next-line
194
197
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
195
- var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
196
- this.parent.trigger('fileOpen', eventArgs);
197
- args.cancel = eventArgs.cancel;
198
- if (args.cancel) {
199
- this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] != args.node.getAttribute('data-uid') : false;
200
- this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
201
- this.previousSelected = this.treeObj.selectedNodes;
202
- if (!isNOU(this.parent) && !isNOU(this.parent.contextmenuModule)) {
203
- this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
198
+ if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked) {
199
+ this.isNodeClickCalled = false;
200
+ if (!this.isSameNodeClicked) {
201
+ this.isSameNodeClicked = true;
202
+ var selecEventArgs = { action: args.action, fileDetails: nodeData[0], isInteracted: args.isInteracted };
203
+ this.parent.trigger('fileSelect', selecEventArgs);
204
204
  }
205
+ if (!this.isRightClick) {
206
+ var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
207
+ this.parent.trigger('fileOpen', eventArgs);
208
+ args.cancel = eventArgs.cancel;
209
+ }
210
+ if (args.cancel) {
211
+ this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] !== args.node.getAttribute('data-uid') : false;
212
+ this.isNodeClickCalled = true;
213
+ this.isSameNodeClicked = false;
214
+ this.previousSelected = this.treeObj.selectedNodes;
215
+ this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
216
+ }
217
+ }
218
+ else if (this.previousSelected[0] !== args.node.getAttribute('data-uid')) {
219
+ var selecEventArgs = { action: args.action, fileDetails: nodeData[0], isInteracted: this.isNodeClickCalled };
220
+ this.parent.trigger('fileSelect', selecEventArgs);
205
221
  }
206
222
  }
207
223
  };
208
224
  // Opens the folder while clicking open context menu item in the treeview.
209
225
  NavigationPane.prototype.openFileOnContextMenuClick = function (node) {
210
226
  var data = this.treeObj.getTreeData(node);
211
- // eslint-disable-next-line
212
227
  this.parent.selectedItems = [];
213
228
  this.parent.itemData = data;
214
229
  this.activeNode = node;
215
230
  this.parent.activeModule = 'navigationpane';
216
- updatePath(node, this.parent.itemData[0], this.parent);
217
- read(this.parent, this.isPathDragged ? events.pasteEnd : events.pathChanged, this.parent.path);
218
- this.parent.visitedItem = node;
219
- this.isPathDragged = this.isRenameParent = this.isRightClick = false;
220
- this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
231
+ var eventArgs = { cancel: false, fileDetails: data[0], module: 'NavigationPane' };
232
+ this.parent.trigger('fileOpen', eventArgs);
233
+ this.isNodeClickCalled = true;
234
+ if (!eventArgs.cancel) {
235
+ updatePath(node, this.parent.itemData[0], this.parent);
236
+ read(this.parent, this.isPathDragged ? events.pasteEnd : events.pathChanged, this.parent.path);
237
+ this.parent.visitedItem = node;
238
+ this.isPathDragged = this.isRenameParent = this.isRightClick = false;
239
+ this.treeObj.selectedNodes = [node.getAttribute('data-uid')];
240
+ }
221
241
  };
222
242
  NavigationPane.prototype.onNodeSelected = function (args) {
223
243
  if (this.parent.breadcrumbbarModule && this.parent.breadcrumbbarModule.searchObj && !this.renameParent) {
224
244
  this.parent.breadcrumbbarModule.searchObj.element.value = '';
225
245
  this.parent.isFiltered = false;
246
+ this.isNodeClickCalled = false;
226
247
  }
227
248
  this.parent.searchedItems = [];
228
- if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent) {
249
+ if (!args.isInteracted && !this.isRightClick && !this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent) {
250
+ this.parent.pathId = getPathId(args.node);
229
251
  return;
230
252
  }
231
253
  this.activeNode = args.node;
232
254
  this.parent.activeModule = 'navigationpane';
233
- // eslint-disable-next-line
234
255
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
235
256
  this.parent.selectedItems = [];
236
257
  this.parent.itemData = nodeData;
237
258
  var previousPath = this.parent.path;
238
- updatePath(args.node, this.parent.itemData[0], this.parent);
259
+ if (!this.isRightClick && this.isSameNodeClicked) {
260
+ updatePath(args.node, this.parent.itemData[0], this.parent);
261
+ }
262
+ else {
263
+ this.parent.pathId = getPathId(args.node);
264
+ this.parent.visitedItem = args.node;
265
+ }
266
+ if (args.node.querySelector('.' + CLS.ICONS) && args.node.querySelector('.' + CLS.LIST_ITEM) === null) {
267
+ this.expandNodeTarget = 'add';
268
+ }
239
269
  if (previousPath !== this.parent.path) {
240
- this.expandNodeTarget = null;
241
- if (args.node.querySelector('.' + CLS.ICONS) && args.node.querySelector('.' + CLS.LIST_ITEM) === null) {
242
- this.expandNodeTarget = 'add';
270
+ if (!this.isRightClick && this.isSameNodeClicked) {
271
+ read(this.parent, this.isPathDragged ? events.pasteEnd : events.pathChanged, this.parent.path);
272
+ this.isNodeClickCalled = true;
243
273
  }
244
- read(this.parent, this.isPathDragged ? events.pasteEnd : events.pathChanged, this.parent.path);
245
274
  this.parent.visitedItem = args.node;
246
275
  }
247
- this.isPathDragged = this.isRenameParent = this.isRightClick = false;
276
+ this.isPathDragged = this.isRenameParent = this.isRightClick = this.isSameNodeClicked = false;
248
277
  };
249
278
  /* istanbul ignore next */
250
- // eslint-disable-next-line
251
279
  NavigationPane.prototype.onPathDrag = function (args) {
252
280
  this.isPathDragged = true;
253
281
  this.selectResultNode(args[0]);
@@ -258,6 +286,7 @@ var NavigationPane = /** @class */ (function () {
258
286
  return;
259
287
  }
260
288
  if (args.node.querySelector('.' + CLS.LIST_ITEM) === null) {
289
+ this.isNodeExpandCalled = true;
261
290
  var text = getValue('text', args.nodeData);
262
291
  var id = args.node.getAttribute('data-id');
263
292
  var isId = isNOU(id) ? false : true;
@@ -266,6 +295,7 @@ var NavigationPane = /** @class */ (function () {
266
295
  this.expandNodeTarget = args.node.getAttribute('data-uid');
267
296
  this.parent.expandedId = this.expandNodeTarget;
268
297
  this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
298
+ this.parent.pathId.push(getValue('id', args.nodeData));
269
299
  read(this.parent, events.nodeExpand, path);
270
300
  }
271
301
  };
@@ -273,6 +303,7 @@ var NavigationPane = /** @class */ (function () {
273
303
  NavigationPane.prototype.onNodeExpanded = function (args) {
274
304
  this.addChild(args.files, this.expandNodeTarget, false);
275
305
  this.parent.expandedId = null;
306
+ this.isNodeExpandCalled = false;
276
307
  };
277
308
  NavigationPane.prototype.onNodeClicked = function (args) {
278
309
  this.parent.activeModule = 'navigationpane';
@@ -288,6 +319,14 @@ var NavigationPane = /** @class */ (function () {
288
319
  var layout = (this.parent.view === 'LargeIcons') ? 'largeiconsview' : 'detailsview';
289
320
  this.parent.notify(events.modelChanged, { module: layout, newProp: { selectedItems: [] } });
290
321
  }
322
+ else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && !this.isNodeClickCalled && !this.isNodeExpandCalled) {
323
+ if (args.event.which === 3) {
324
+ this.isRightClick = true;
325
+ }
326
+ this.isSameNodeClicked = true;
327
+ this.isNodeClickCalled = true;
328
+ this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
329
+ }
291
330
  };
292
331
  /* istanbul ignore next */
293
332
  NavigationPane.prototype.onNodeEditing = function (args) {
@@ -297,11 +336,10 @@ var NavigationPane = /** @class */ (function () {
297
336
  };
298
337
  NavigationPane.prototype.onPathChanged = function (args) {
299
338
  this.parent.isCut = false;
300
- // eslint-disable-next-line
301
339
  var currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
302
340
  if (this.expandNodeTarget === 'add') {
303
341
  var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
304
- var ul = select('.' + CLS.LIST_PARENT, sNode);
342
+ var ul = (!isNOU(sNode)) ? select('.' + CLS.LIST_PARENT, sNode) : null;
305
343
  if (isNOU(ul)) {
306
344
  this.addChild(args.files, this.treeObj.selectedNodes[0], !this.expandTree);
307
345
  }
@@ -311,6 +349,9 @@ var NavigationPane = /** @class */ (function () {
311
349
  if (isNOU(currFiles)) {
312
350
  setValue(this.parent.pathId[this.parent.pathId.length - 1], args.files, this.parent.feFiles);
313
351
  }
352
+ if (this.parent.uploadObj.directoryUpload && !(this.parent.hasId)) {
353
+ this.updateTree(args);
354
+ }
314
355
  };
315
356
  NavigationPane.prototype.updateTree = function (args) {
316
357
  if (this.treeObj) {
@@ -352,7 +393,6 @@ var NavigationPane = /** @class */ (function () {
352
393
  NavigationPane.prototype.onFinalizeEnd = function (args) {
353
394
  this.onInit();
354
395
  var id = getValue('_fm_id', args.cwd);
355
- this.removeChildNodes(id);
356
396
  this.addChild(args.files, id, false);
357
397
  this.treeObj.selectedNodes = [this.parent.pathId[this.parent.pathId.length - 1]];
358
398
  };
@@ -400,14 +440,12 @@ var NavigationPane = /** @class */ (function () {
400
440
  this.renameParent = null;
401
441
  }
402
442
  else {
403
- // eslint-disable-next-line
404
443
  var resultData = [];
405
444
  if (this.parent.hasId) {
406
445
  resultData = new DataManager(this.treeObj.getTreeData()).
407
446
  executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
408
447
  }
409
448
  else {
410
- // eslint-disable-next-line
411
449
  var nData = new DataManager(this.treeObj.getTreeData()).
412
450
  executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.renameText, false));
413
451
  if (nData.length > 0) {
@@ -416,7 +454,6 @@ var NavigationPane = /** @class */ (function () {
416
454
  }
417
455
  }
418
456
  if (resultData.length > 0) {
419
- this.isRenameParent = true;
420
457
  var id_1 = getValue(this.treeObj.fields.id, resultData[0]);
421
458
  this.treeObj.selectedNodes = [id_1];
422
459
  this.treeObj.dataBind();
@@ -429,16 +466,13 @@ var NavigationPane = /** @class */ (function () {
429
466
  this.updateTree(args);
430
467
  }
431
468
  else {
432
- // eslint-disable-next-line
433
469
  var data = this.treeObj.getTreeData();
434
- // eslint-disable-next-line
435
470
  var resultData = [];
436
471
  if (this.parent.hasId) {
437
472
  resultData = new DataManager(data).
438
473
  executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
439
474
  }
440
475
  else {
441
- // eslint-disable-next-line
442
476
  var nData = new DataManager(data).
443
477
  executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.currentItemText, false));
444
478
  if (nData.length > 0) {
@@ -494,7 +528,6 @@ var NavigationPane = /** @class */ (function () {
494
528
  }
495
529
  this.treeObj.removeNodes(moveNames);
496
530
  };
497
- // eslint-disable-next-line
498
531
  NavigationPane.prototype.getMoveNames = function (files, flag, path) {
499
532
  var moveNames = [];
500
533
  for (var i = 0; i < files.length; i++) {
@@ -507,7 +540,6 @@ var NavigationPane = /** @class */ (function () {
507
540
  name_2 = path.substring(index + 1);
508
541
  path = path.substring(0, index + 1);
509
542
  }
510
- // eslint-disable-next-line
511
543
  var resultData = new DataManager(this.treeObj.getTreeData()).
512
544
  executeLocal(new Query().where(this.treeObj.fields.text, 'equal', name_2, false));
513
545
  for (var j = 0; j < resultData.length; j++) {
@@ -534,16 +566,13 @@ var NavigationPane = /** @class */ (function () {
534
566
  this.treeObj.removeNodes(moveNames);
535
567
  };
536
568
  /* istanbul ignore next */
537
- // eslint-disable-next-line
538
569
  NavigationPane.prototype.selectResultNode = function (resultObj) {
539
570
  if (!this.parent.hasId) {
540
571
  var path = getValue('filterPath', resultObj);
541
572
  var itemname = getValue('name', resultObj);
542
- // eslint-disable-next-line
543
573
  var data = new DataManager(this.treeObj.getTreeData()).
544
574
  executeLocal(new Query().where(this.treeObj.fields.text, 'equal', itemname, false));
545
575
  if (data.length > 0) {
546
- // eslint-disable-next-line
547
576
  var resultData = new DataManager(data).
548
577
  executeLocal(new Query().where('filterPath', 'equal', path, false));
549
578
  if (resultData.length > 0) {
@@ -554,7 +583,8 @@ var NavigationPane = /** @class */ (function () {
554
583
  }
555
584
  }
556
585
  else {
557
- this.treeObj.selectedNodes = [getValue('_fm_id', resultObj)];
586
+ var selectedNode = this.treeObj.getTreeData().filter(function (obj) { return obj.name === resultObj.name; })[0];
587
+ this.treeObj.selectedNodes = [getValue('_fm_id', selectedNode)];
558
588
  this.treeObj.dataBind();
559
589
  }
560
590
  };
@@ -564,14 +594,12 @@ var NavigationPane = /** @class */ (function () {
564
594
  this.parent.isDropEnd = !this.parent.isPasteError;
565
595
  };
566
596
  NavigationPane.prototype.onpasteEnd = function (args) {
567
- // eslint-disable-next-line
568
597
  var resultData = [];
569
598
  if (this.parent.hasId) {
570
599
  resultData = new DataManager(this.treeObj.getTreeData()).
571
600
  executeLocal(new Query().where('id', 'equal', getValue('id', args.cwd), false));
572
601
  }
573
602
  else {
574
- // eslint-disable-next-line
575
603
  var nData = new DataManager(this.treeObj.getTreeData()).
576
604
  executeLocal(new Query().where(this.treeObj.fields.text, 'equal', getValue('name', args.cwd), false));
577
605
  if (nData.length > 0) {
@@ -593,6 +621,9 @@ var NavigationPane = /** @class */ (function () {
593
621
  };
594
622
  /* istanbul ignore next */
595
623
  NavigationPane.prototype.checkDropPath = function (args) {
624
+ if (isFileSystemData(this.parent) && (this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane')) {
625
+ return;
626
+ }
596
627
  if (this.parent.hasId) {
597
628
  this.parent.isDropEnd = !this.parent.isPasteError;
598
629
  readDropPath(this.parent);
@@ -611,8 +642,7 @@ var NavigationPane = /** @class */ (function () {
611
642
  this.updateItemData();
612
643
  }
613
644
  this.moveNames = [];
614
- // eslint-disable-next-line
615
- var obj = this.parent.isDragDrop ? this.parent.dragData : this.parent.actionRecords;
645
+ var obj = this.parent.isDragDrop || isFileSystemData(this.parent) ? this.parent.dragData : this.parent.actionRecords;
616
646
  for (var i = 0; i < obj.length; i++) {
617
647
  if (getValue('isFile', obj[i]) === false) {
618
648
  this.moveNames.push(getValue('_fm_id', obj[i]));
@@ -692,12 +722,10 @@ var NavigationPane = /** @class */ (function () {
692
722
  /* istanbul ignore next */
693
723
  NavigationPane.prototype.onDetailsInit = function () {
694
724
  if (this.parent.activeModule === this.getModuleName()) {
695
- // eslint-disable-next-line
696
725
  var dataobj = this.getTreeData(this.treeObj.selectedNodes[0]);
697
726
  this.parent.itemData = dataobj;
698
727
  }
699
728
  };
700
- // eslint-disable-next-line
701
729
  NavigationPane.prototype.onMenuItemData = function (args) {
702
730
  if (this.parent.activeModule === this.getModuleName()) {
703
731
  var liEle = closest(args.target, 'li');
@@ -795,7 +823,6 @@ var NavigationPane = /** @class */ (function () {
795
823
  break;
796
824
  case 'f2':
797
825
  if (this.parent.selectedItems.length === 0) {
798
- // eslint-disable-next-line
799
826
  var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
800
827
  if (!hasEditAccess(data)) {
801
828
  createDeniedDialog(this.parent, data, events.permissionEdit);
@@ -808,9 +835,7 @@ var NavigationPane = /** @class */ (function () {
808
835
  break;
809
836
  }
810
837
  };
811
- // eslint-disable-next-line
812
838
  NavigationPane.prototype.getTreeData = function (args) {
813
- // eslint-disable-next-line
814
839
  var data = this.treeObj.getTreeData(args);
815
840
  for (var i = 0; i < data.length; i++) {
816
841
  if (isNOU(getValue('hasChild', data[i]))) {
@@ -824,7 +849,6 @@ var NavigationPane = /** @class */ (function () {
824
849
  this.parent.currentItemText = getValue('name', this.parent.itemData[0]);
825
850
  };
826
851
  NavigationPane.prototype.updateItemData = function () {
827
- // eslint-disable-next-line
828
852
  var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
829
853
  this.parent.itemData = [data];
830
854
  this.parent.isFile = false;
@@ -1,4 +1,4 @@
1
- import { Property, ChildProperty, NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';
1
+ import { Property, ChildProperty, NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';import { SortComparer } from '../base/interface';
2
2
  import {TextAlign} from "./column";
3
3
 
4
4
  /**
@@ -82,15 +82,27 @@ export interface ColumnModel {
82
82
  * It accepts either [template string](https://ej2.syncfusion.com/documentation/common/template-engine/) or HTML element ID.
83
83
  *
84
84
  * @default null
85
+ * @aspType string
86
+ */
87
+ template?: string | Function;
88
+
89
+ /**
90
+ * Defines the custom sort comparer function.
91
+ * The sort comparer function has the same functionality like
92
+ * [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) sort comparer.
93
+ *
94
+ * @default null
95
+ * @aspType string
85
96
  */
86
- template?: string;
97
+ sortComparer?: SortComparer | string;
87
98
 
88
99
  /**
89
100
  * Defines the column template as string or HTML element ID which is used to add customized element in the column header.
90
101
  *
91
102
  * @default null
103
+ * @aspType string
92
104
  */
93
- headerTemplate?: string;
105
+ headerTemplate?: string | Function;
94
106
 
95
107
  /**
96
108
  * If `allowSorting` set to false, then it disables sorting option of a particular column.
@@ -112,7 +124,6 @@ export interface ColumnModel {
112
124
  *
113
125
  * @default null
114
126
  */
115
- /* eslint-disable */
116
127
  customAttributes?: { [x: string]: Object };
117
128
 
118
129
  /**
@@ -131,7 +142,14 @@ export interface ColumnModel {
131
142
  *
132
143
  * @default null
133
144
  */
134
- /* eslint-disable */
135
145
  customFormat?: { [x: string]: Object };
136
146
 
147
+ /**
148
+ * If `isPrimaryKey` is set to true, considers this column as the primary key constraint.
149
+ *
150
+ * @deprecated
151
+ * @default false
152
+ */
153
+ isPrimaryKey?: boolean;
154
+
137
155
  }
@@ -1,4 +1,5 @@
1
1
  import { ChildProperty, NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';
2
+ import { SortComparer } from '../base/interface';
2
3
  /**
3
4
  * Defines alignments of text, they are
4
5
  * * Left
@@ -110,14 +111,25 @@ export declare class Column extends ChildProperty<Column> {
110
111
  * It accepts either [template string](https://ej2.syncfusion.com/documentation/common/template-engine/) or HTML element ID.
111
112
  *
112
113
  * @default null
114
+ * @aspType string
115
+ */
116
+ template: string | Function;
117
+ /**
118
+ * Defines the custom sort comparer function.
119
+ * The sort comparer function has the same functionality like
120
+ * [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) sort comparer.
121
+ *
122
+ * @default null
123
+ * @aspType string
113
124
  */
114
- template: string;
125
+ sortComparer: SortComparer | string;
115
126
  /**
116
127
  * Defines the column template as string or HTML element ID which is used to add customized element in the column header.
117
128
  *
118
129
  * @default null
130
+ * @aspType string
119
131
  */
120
- headerTemplate: string;
132
+ headerTemplate: string | Function;
121
133
  /**
122
134
  * If `allowSorting` set to false, then it disables sorting option of a particular column.
123
135
  * By default all columns are sortable.
@@ -157,4 +169,11 @@ export declare class Column extends ChildProperty<Column> {
157
169
  customFormat: {
158
170
  [x: string]: Object;
159
171
  };
172
+ /**
173
+ * If `isPrimaryKey` is set to true, considers this column as the primary key constraint.
174
+ *
175
+ * @deprecated
176
+ * @default false
177
+ */
178
+ isPrimaryKey: boolean;
160
179
  }
@@ -57,6 +57,9 @@ var Column = /** @class */ (function (_super) {
57
57
  __decorate([
58
58
  Property(null)
59
59
  ], Column.prototype, "template", void 0);
60
+ __decorate([
61
+ Property(null)
62
+ ], Column.prototype, "sortComparer", void 0);
60
63
  __decorate([
61
64
  Property(null)
62
65
  ], Column.prototype, "headerTemplate", void 0);
@@ -75,6 +78,9 @@ var Column = /** @class */ (function (_super) {
75
78
  __decorate([
76
79
  Property(null)
77
80
  ], Column.prototype, "customFormat", void 0);
81
+ __decorate([
82
+ Property(false)
83
+ ], Column.prototype, "isPrimaryKey", void 0);
78
84
  return Column;
79
85
  }(ChildProperty));
80
86
  export { Column };
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Specifies the default locale of FileManager component
3
3
  */
4
- // eslint-disable-next-line
5
4
  export var defaultLocale = {
6
5
  'NewFolder': 'New folder',
7
6
  'Upload': 'Upload',
@@ -1,4 +1,4 @@
1
- import { Property, ChildProperty } from '@syncfusion/ej2-base';import { ColumnModel } from './index';
1
+ import { Property, ChildProperty, initializeCSPTemplate } from '@syncfusion/ej2-base';import { ColumnModel } from './index';
2
2
 
3
3
  /**
4
4
  * Interface for a class DetailsViewSettings
@@ -17,21 +17,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
17
17
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
18
  return c > 3 && r && Object.defineProperty(target, key, r), r;
19
19
  };
20
- import { Property, ChildProperty } from '@syncfusion/ej2-base';
20
+ import { Property, ChildProperty, initializeCSPTemplate } from '@syncfusion/ej2-base';
21
21
  /**
22
22
  * Specifies the columns in the details view of the file manager.
23
23
  */
24
24
  export var columnArray = [
25
25
  {
26
26
  field: 'name', headerText: 'Name', minWidth: 120,
27
- template: '<span class="e-fe-text">${name}</span>', customAttributes: { class: 'e-fe-grid-name' }
27
+ template: '<span class="e-fe-text">${name}</span>',
28
+ customAttributes: { class: 'e-fe-grid-name' }
28
29
  },
29
30
  {
30
31
  field: '_fm_modified', headerText: 'DateModified', type: 'dateTime',
31
32
  format: 'MMMM dd, yyyy HH:mm', minWidth: 120, width: '190'
32
33
  },
33
34
  {
34
- field: 'size', headerText: 'Size', minWidth: 90, width: '110', template: '<span class="e-fe-size">${size}</span>'
35
+ field: 'size', headerText: 'Size', minWidth: 90, width: '110',
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ template: initializeCSPTemplate(function (data) {
38
+ return "<span class=\"e-fe-size\">" + data.size + "</span>";
39
+ }), format: 'n2'
35
40
  }
36
41
  ];
37
42
  /**
@@ -22,13 +22,13 @@ export declare class NavigationPaneSettings extends ChildProperty<NavigationPane
22
22
  */
23
23
  visible: boolean;
24
24
  /**
25
- * Specifies a value that indicates how to sort the folders in the navigation pane of the file manager component.
26
- *
27
- * If the sortOrder is Ascending, the folders are sorted in ascending order.
28
- * If the sortOrder is Descending, the folders are sorted in descending order.
29
- * If the sortOrder is None, the folders are not sorted.
30
- *
31
- * @default 'None'
32
- */
25
+ * Specifies a value that indicates how to sort the folders in the navigation pane of the file manager component.
26
+ *
27
+ * If the sortOrder is Ascending, the folders are sorted in ascending order.
28
+ * If the sortOrder is Descending, the folders are sorted in descending order.
29
+ * If the sortOrder is None, the folders are not sorted.
30
+ *
31
+ * @default 'None'
32
+ */
33
33
  sortOrder: 'None' | 'Ascending' | 'Descending';
34
34
  }