@syncfusion/ej2-filemanager 31.2.2 → 32.1.19

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 (205) hide show
  1. package/README.md +10 -2
  2. package/dist/ej2-filemanager.min.js +1 -10
  3. package/dist/ej2-filemanager.umd.min.js +1 -10
  4. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-filemanager.es2015.js +165 -47
  6. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  7. package/dist/es6/ej2-filemanager.es5.js +176 -47
  8. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  9. package/dist/global/ej2-filemanager.min.js +1 -10
  10. package/dist/global/ej2-filemanager.min.js.map +1 -1
  11. package/dist/global/index.d.ts +0 -9
  12. package/package.json +11 -11
  13. package/src/file-manager/base/classes.d.ts +4 -0
  14. package/src/file-manager/base/classes.js +4 -0
  15. package/src/file-manager/base/file-manager-model.d.ts +28 -1
  16. package/src/file-manager/base/file-manager.d.ts +27 -1
  17. package/src/file-manager/base/file-manager.js +44 -1
  18. package/src/file-manager/base/interface.d.ts +4 -1
  19. package/src/file-manager/common/operations.js +1 -0
  20. package/src/file-manager/common/utility.d.ts +8 -4
  21. package/src/file-manager/common/utility.js +32 -15
  22. package/src/file-manager/layout/details-view.js +5 -1
  23. package/src/file-manager/layout/large-icons-view.js +17 -10
  24. package/src/file-manager/layout/navigation-pane.js +32 -13
  25. package/src/file-manager/models/default-locale.js +4 -0
  26. package/src/file-manager/models/upload-settings-model.d.ts +8 -0
  27. package/src/file-manager/models/upload-settings.d.ts +7 -0
  28. package/src/file-manager/models/upload-settings.js +3 -0
  29. package/src/file-manager/pop-up/context-menu.d.ts +1 -0
  30. package/src/file-manager/pop-up/context-menu.js +32 -5
  31. package/styles/bds-lite.css +72 -8
  32. package/styles/bds-lite.scss +15 -16
  33. package/styles/bds.css +78 -14
  34. package/styles/bds.scss +16 -17
  35. package/styles/bootstrap-dark-lite.css +5 -0
  36. package/styles/bootstrap-dark-lite.scss +15 -16
  37. package/styles/bootstrap-dark.css +7 -2
  38. package/styles/bootstrap-dark.scss +16 -17
  39. package/styles/bootstrap-lite.css +5 -0
  40. package/styles/bootstrap-lite.scss +15 -16
  41. package/styles/bootstrap.css +7 -2
  42. package/styles/bootstrap.scss +16 -17
  43. package/styles/bootstrap4-lite.css +5 -0
  44. package/styles/bootstrap4-lite.scss +15 -16
  45. package/styles/bootstrap4.css +7 -2
  46. package/styles/bootstrap4.scss +16 -17
  47. package/styles/bootstrap5-dark-lite.css +5 -0
  48. package/styles/bootstrap5-dark-lite.scss +15 -16
  49. package/styles/bootstrap5-dark.css +7 -2
  50. package/styles/bootstrap5-dark.scss +16 -17
  51. package/styles/bootstrap5-lite.css +5 -0
  52. package/styles/bootstrap5-lite.scss +16 -16
  53. package/styles/bootstrap5.3-lite.css +85 -0
  54. package/styles/bootstrap5.3-lite.scss +16 -16
  55. package/styles/bootstrap5.3.css +87 -2
  56. package/styles/bootstrap5.3.scss +17 -17
  57. package/styles/bootstrap5.css +7 -2
  58. package/styles/bootstrap5.scss +17 -17
  59. package/styles/fabric-dark-lite.css +5 -0
  60. package/styles/fabric-dark-lite.scss +16 -16
  61. package/styles/fabric-dark.css +7 -2
  62. package/styles/fabric-dark.scss +17 -17
  63. package/styles/fabric-lite.css +5 -0
  64. package/styles/fabric-lite.scss +16 -16
  65. package/styles/fabric.css +7 -2
  66. package/styles/fabric.scss +17 -17
  67. package/styles/file-manager/_all.scss +2 -2
  68. package/styles/file-manager/_bds-definition.scss +82 -0
  69. package/styles/file-manager/_bigger.scss +79 -71
  70. package/styles/file-manager/_bootstrap-dark-definition.scss +79 -0
  71. package/styles/file-manager/_bootstrap-definition.scss +79 -0
  72. package/styles/file-manager/_bootstrap4-definition.scss +79 -0
  73. package/styles/file-manager/_bootstrap5-dark-definition.scss +322 -1
  74. package/styles/file-manager/_bootstrap5-definition.scss +77 -0
  75. package/styles/file-manager/_bootstrap5.3-definition.scss +80 -0
  76. package/styles/file-manager/_fabric-dark-definition.scss +79 -0
  77. package/styles/file-manager/_fabric-definition.scss +78 -0
  78. package/styles/file-manager/_fluent-dark-definition.scss +330 -1
  79. package/styles/file-manager/_fluent-definition.scss +78 -0
  80. package/styles/file-manager/_fluent2-definition.scss +82 -1
  81. package/styles/file-manager/_fusionnew-definition.scss +79 -0
  82. package/styles/file-manager/_highcontrast-definition.scss +79 -0
  83. package/styles/file-manager/_highcontrast-light-definition.scss +79 -0
  84. package/styles/file-manager/_layout.scss +125 -128
  85. package/styles/file-manager/_material-dark-definition.scss +78 -0
  86. package/styles/file-manager/_material-definition.scss +77 -0
  87. package/styles/file-manager/_material3-dark-definition.scss +310 -1
  88. package/styles/file-manager/_material3-definition.scss +75 -0
  89. package/styles/file-manager/_tailwind-dark-definition.scss +315 -1
  90. package/styles/file-manager/_tailwind-definition.scss +76 -0
  91. package/styles/file-manager/_tailwind3-definition.scss +105 -2
  92. package/styles/file-manager/_theme-variables.scss +1 -0
  93. package/styles/file-manager/_theme.scss +6 -1
  94. package/styles/file-manager/bds.css +78 -14
  95. package/styles/file-manager/bds.scss +17 -17
  96. package/styles/file-manager/bootstrap-dark.css +7 -2
  97. package/styles/file-manager/bootstrap-dark.scss +17 -17
  98. package/styles/file-manager/bootstrap.css +7 -2
  99. package/styles/file-manager/bootstrap.scss +17 -17
  100. package/styles/file-manager/bootstrap4.css +7 -2
  101. package/styles/file-manager/bootstrap4.scss +17 -17
  102. package/styles/file-manager/bootstrap5-dark.css +7 -2
  103. package/styles/file-manager/bootstrap5-dark.scss +17 -17
  104. package/styles/file-manager/bootstrap5.3.css +87 -2
  105. package/styles/file-manager/bootstrap5.3.scss +17 -17
  106. package/styles/file-manager/bootstrap5.css +7 -2
  107. package/styles/file-manager/bootstrap5.scss +17 -17
  108. package/styles/file-manager/fabric-dark.css +7 -2
  109. package/styles/file-manager/fabric-dark.scss +17 -17
  110. package/styles/file-manager/fabric.css +7 -2
  111. package/styles/file-manager/fabric.scss +17 -17
  112. package/styles/file-manager/fluent-dark.css +7 -2
  113. package/styles/file-manager/fluent-dark.scss +17 -17
  114. package/styles/file-manager/fluent.css +7 -2
  115. package/styles/file-manager/fluent.scss +17 -17
  116. package/styles/file-manager/fluent2.css +124 -6
  117. package/styles/file-manager/fluent2.scss +17 -17
  118. package/styles/file-manager/highcontrast-light.css +7 -2
  119. package/styles/file-manager/highcontrast-light.scss +17 -17
  120. package/styles/file-manager/highcontrast.css +7 -2
  121. package/styles/file-manager/highcontrast.scss +17 -17
  122. package/styles/file-manager/icons/_bds.scss +1 -0
  123. package/styles/file-manager/icons/_bootstrap-dark.scss +1 -0
  124. package/styles/file-manager/icons/_bootstrap.scss +1 -0
  125. package/styles/file-manager/icons/_bootstrap4.scss +1 -0
  126. package/styles/file-manager/icons/_bootstrap5-dark.scss +1 -1
  127. package/styles/file-manager/icons/_bootstrap5.3.scss +1 -0
  128. package/styles/file-manager/icons/_bootstrap5.scss +1 -0
  129. package/styles/file-manager/icons/_fabric-dark.scss +1 -0
  130. package/styles/file-manager/icons/_fabric.scss +1 -0
  131. package/styles/file-manager/icons/_fluent-dark.scss +1 -1
  132. package/styles/file-manager/icons/_fluent.scss +1 -0
  133. package/styles/file-manager/icons/_fluent2.scss +1 -0
  134. package/styles/file-manager/icons/_fusionnew.scss +1 -0
  135. package/styles/file-manager/icons/_highcontrast-light.scss +1 -0
  136. package/styles/file-manager/icons/_highcontrast.scss +1 -0
  137. package/styles/file-manager/icons/_material-dark.scss +1 -0
  138. package/styles/file-manager/icons/_material.scss +1 -0
  139. package/styles/file-manager/icons/_material3-dark.scss +1 -1
  140. package/styles/file-manager/icons/_material3.scss +1 -0
  141. package/styles/file-manager/icons/_tailwind-dark.scss +1 -1
  142. package/styles/file-manager/icons/_tailwind.scss +1 -0
  143. package/styles/file-manager/icons/_tailwind3.scss +1 -0
  144. package/styles/file-manager/material-dark.css +7 -2
  145. package/styles/file-manager/material-dark.scss +17 -17
  146. package/styles/file-manager/material.css +6 -1
  147. package/styles/file-manager/material.scss +17 -17
  148. package/styles/file-manager/material3-dark.css +90 -5
  149. package/styles/file-manager/material3-dark.scss +17 -18
  150. package/styles/file-manager/material3.css +90 -5
  151. package/styles/file-manager/material3.scss +17 -18
  152. package/styles/file-manager/tailwind-dark.css +8 -3
  153. package/styles/file-manager/tailwind-dark.scss +17 -17
  154. package/styles/file-manager/tailwind.css +8 -3
  155. package/styles/file-manager/tailwind.scss +17 -17
  156. package/styles/file-manager/tailwind3.css +128 -8
  157. package/styles/file-manager/tailwind3.scss +17 -17
  158. package/styles/fluent-dark-lite.css +5 -0
  159. package/styles/fluent-dark-lite.scss +16 -16
  160. package/styles/fluent-dark.css +7 -2
  161. package/styles/fluent-dark.scss +17 -17
  162. package/styles/fluent-lite.css +5 -0
  163. package/styles/fluent-lite.scss +16 -16
  164. package/styles/fluent.css +7 -2
  165. package/styles/fluent.scss +17 -17
  166. package/styles/fluent2-lite.css +123 -5
  167. package/styles/fluent2-lite.scss +16 -16
  168. package/styles/fluent2.css +124 -6
  169. package/styles/fluent2.scss +17 -17
  170. package/styles/highcontrast-light-lite.css +5 -0
  171. package/styles/highcontrast-light-lite.scss +16 -16
  172. package/styles/highcontrast-light.css +7 -2
  173. package/styles/highcontrast-light.scss +17 -17
  174. package/styles/highcontrast-lite.css +5 -0
  175. package/styles/highcontrast-lite.scss +16 -16
  176. package/styles/highcontrast.css +7 -2
  177. package/styles/highcontrast.scss +17 -17
  178. package/styles/material-dark-lite.css +5 -0
  179. package/styles/material-dark-lite.scss +16 -16
  180. package/styles/material-dark.css +7 -2
  181. package/styles/material-dark.scss +17 -17
  182. package/styles/material-lite.css +5 -0
  183. package/styles/material-lite.scss +15 -16
  184. package/styles/material.css +6 -1
  185. package/styles/material.scss +16 -17
  186. package/styles/material3-dark-lite.css +89 -4
  187. package/styles/material3-dark-lite.scss +16 -16
  188. package/styles/material3-dark.css +90 -5
  189. package/styles/material3-dark.scss +17 -19
  190. package/styles/material3-lite.css +89 -4
  191. package/styles/material3-lite.scss +16 -16
  192. package/styles/material3.css +90 -5
  193. package/styles/material3.scss +17 -19
  194. package/styles/tailwind-dark-lite.css +5 -0
  195. package/styles/tailwind-dark-lite.scss +16 -16
  196. package/styles/tailwind-dark.css +8 -3
  197. package/styles/tailwind-dark.scss +17 -17
  198. package/styles/tailwind-lite.css +5 -0
  199. package/styles/tailwind-lite.scss +16 -16
  200. package/styles/tailwind.css +8 -3
  201. package/styles/tailwind.scss +17 -17
  202. package/styles/tailwind3-lite.css +126 -6
  203. package/styles/tailwind3-lite.scss +16 -16
  204. package/styles/tailwind3.css +128 -8
  205. package/styles/tailwind3.scss +17 -17
@@ -1,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 31.2.2
4
- * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _filemanager from '@syncfusion/ej2-filemanager';
11
2
 
12
3
  export declare namespace ej {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-filemanager",
3
- "version": "31.2.2",
3
+ "version": "32.1.19",
4
4
  "description": "Essential JS 2 FileManager Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,16 +8,16 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-filemanager.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~31.2.2",
12
- "@syncfusion/ej2-buttons": "~31.2.2",
13
- "@syncfusion/ej2-data": "~31.2.2",
14
- "@syncfusion/ej2-grids": "~31.2.2",
15
- "@syncfusion/ej2-inputs": "~31.2.2",
16
- "@syncfusion/ej2-layouts": "~31.2.2",
17
- "@syncfusion/ej2-lists": "~31.2.2",
18
- "@syncfusion/ej2-navigations": "~31.2.2",
19
- "@syncfusion/ej2-popups": "~31.2.2",
20
- "@syncfusion/ej2-splitbuttons": "~31.2.2"
11
+ "@syncfusion/ej2-base": "~32.1.19",
12
+ "@syncfusion/ej2-buttons": "~32.1.19",
13
+ "@syncfusion/ej2-data": "~32.1.19",
14
+ "@syncfusion/ej2-grids": "~32.1.19",
15
+ "@syncfusion/ej2-inputs": "~32.1.19",
16
+ "@syncfusion/ej2-layouts": "~32.1.19",
17
+ "@syncfusion/ej2-lists": "~32.1.19",
18
+ "@syncfusion/ej2-navigations": "~32.1.19",
19
+ "@syncfusion/ej2-popups": "~32.1.19",
20
+ "@syncfusion/ej2-splitbuttons": "~32.1.19"
21
21
  },
22
22
  "devDependencies": {},
23
23
  "keywords": [
@@ -185,6 +185,10 @@ export declare const ICON_GRID: string;
185
185
  /** @hidden */
186
186
  export declare const ICON_LARGE: string;
187
187
  /** @hidden */
188
+ export declare const ICON_FOLDER: string;
189
+ /** @hidden */
190
+ export declare const ICON_FILE: string;
191
+ /** @hidden */
188
192
  export declare const ICON_BREADCRUMB: string;
189
193
  /** @hidden */
190
194
  export declare const ICON_CLEAR: string;
@@ -185,6 +185,10 @@ export var ICON_GRID = 'e-icons e-fe-grid';
185
185
  /** @hidden */
186
186
  export var ICON_LARGE = 'e-icons e-fe-large';
187
187
  /** @hidden */
188
+ export var ICON_FOLDER = 'e-icons e-folder';
189
+ /** @hidden */
190
+ export var ICON_FILE = 'e-icons e-file-format';
191
+ /** @hidden */
188
192
  export var ICON_BREADCRUMB = 'e-icons e-fe-breadcrumb';
189
193
  /** @hidden */
190
194
  export var ICON_CLEAR = 'e-icons e-fe-clear';
@@ -34,6 +34,32 @@ export interface FileManagerModel extends ComponentModel{
34
34
  */
35
35
  allowDragAndDrop?: boolean;
36
36
 
37
+ /**
38
+ * Specifies a template to render customized content for all the nodes. If the `navigationPaneTemplate` property
39
+ * is set, the template content overrides the displayed node text in the File Manager navigation pane.
40
+ * The property accepts a template string or HTML element ID holding the content.
41
+ *
42
+ * @default null
43
+ * @angularType string | object
44
+ * @reactType string | function | JSX.Element
45
+ * @vueType string | function
46
+ * @aspType string
47
+ */
48
+ navigationPaneTemplate?: string | Function;
49
+
50
+ /**
51
+ * Specifies a template to render customized content for all the files or folders in the large icons view. If the `largeIconsTemplate` property
52
+ * is set, the template content overrides the displayed files or folders text in the File Manager large icons view. The property accepts template string
53
+ * or HTML element ID holding the content.
54
+ *
55
+ * @default null
56
+ * @angularType string | object
57
+ * @reactType string | function | JSX.Element
58
+ * @vueType string | function
59
+ * @aspType string
60
+ */
61
+ largeIconsTemplate?: string | Function;
62
+
37
63
  /**
38
64
  * Enables or disables the multiple files selection of the file manager.
39
65
  *
@@ -267,7 +293,8 @@ export interface FileManagerModel extends ComponentModel{
267
293
  * maxFileSize: 30000000,
268
294
  * allowedExtensions: '',
269
295
  * autoClose: false,
270
- * directoryUpload: false
296
+ * directoryUpload: false,
297
+ * sequentialUpload: false
271
298
  * }
272
299
  */
273
300
  uploadSettings?: UploadSettingsModel;
@@ -185,6 +185,30 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
185
185
  * @default false
186
186
  */
187
187
  allowDragAndDrop: boolean;
188
+ /**
189
+ * Specifies a template to render customized content for all the nodes. If the `navigationPaneTemplate` property
190
+ * is set, the template content overrides the displayed node text in the File Manager navigation pane.
191
+ * The property accepts a template string or HTML element ID holding the content.
192
+ *
193
+ * @default null
194
+ * @angularType string | object
195
+ * @reactType string | function | JSX.Element
196
+ * @vueType string | function
197
+ * @aspType string
198
+ */
199
+ navigationPaneTemplate: string | Function;
200
+ /**
201
+ * Specifies a template to render customized content for all the files or folders in the large icons view. If the `largeIconsTemplate` property
202
+ * is set, the template content overrides the displayed files or folders text in the File Manager large icons view. The property accepts template string
203
+ * or HTML element ID holding the content.
204
+ *
205
+ * @default null
206
+ * @angularType string | object
207
+ * @reactType string | function | JSX.Element
208
+ * @vueType string | function
209
+ * @aspType string
210
+ */
211
+ largeIconsTemplate: string | Function;
188
212
  /**
189
213
  * Enables or disables the multiple files selection of the file manager.
190
214
  *
@@ -393,7 +417,8 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
393
417
  * maxFileSize: 30000000,
394
418
  * allowedExtensions: '',
395
419
  * autoClose: false,
396
- * directoryUpload: false
420
+ * directoryUpload: false,
421
+ * sequentialUpload: false
397
422
  * }
398
423
  */
399
424
  uploadSettings: UploadSettingsModel;
@@ -667,6 +692,7 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
667
692
  private onCancel;
668
693
  private onClearing;
669
694
  private onSelected;
695
+ private allowOrDenyUpload;
670
696
  private onFileUploadSuccess;
671
697
  private onChunkUploadComplete;
672
698
  private onUploadSuccess;
@@ -441,6 +441,7 @@ var FileManager = /** @class */ (function (_super) {
441
441
  maxFileSize: this.uploadSettings.maxFileSize,
442
442
  allowedExtensions: this.uploadSettings.allowedExtensions,
443
443
  directoryUpload: this.uploadSettings.directoryUpload,
444
+ sequentialUpload: this.uploadSettings.sequentialUpload,
444
445
  fileListRendering: this.onFileListRender.bind(this)
445
446
  });
446
447
  this.uploadObj.appendTo('#' + this.element.id + CLS.UPLOAD_ID);
@@ -577,8 +578,34 @@ var FileManager = /** @class */ (function (_super) {
577
578
  createDeniedDialog(this, details, events.permissionUpload);
578
579
  return;
579
580
  }
581
+ if (this.allowOrDenyUpload(args, details)) {
582
+ args.cancel = true;
583
+ createDeniedDialog(this, details, events.permissionUpload);
584
+ return;
585
+ }
580
586
  this.uploadDialogObj.show();
581
587
  };
588
+ FileManager.prototype.allowOrDenyUpload = function (args, uploadDetails) {
589
+ var permission = getValue('permission', uploadDetails);
590
+ if (isNOU(args) || isNOU(permission) || isNOU(getValue('uploadContentFilter', permission))) {
591
+ return false;
592
+ }
593
+ var hasFolder = args.filesData.some(function (f) {
594
+ var name = !isNOU(f.name) ? f.name : '';
595
+ return name.includes('/') || name.includes('\\');
596
+ });
597
+ var hasFile = args.filesData.some(function (f) {
598
+ var name = !isNOU(f.name) ? f.name : '';
599
+ return !(name.includes('/') || name.includes('\\'));
600
+ });
601
+ if (hasFolder && getValue('uploadContentFilter', permission) === 1) {
602
+ return true;
603
+ }
604
+ if (hasFile && getValue('uploadContentFilter', permission) === 2) {
605
+ return true;
606
+ }
607
+ return false;
608
+ };
582
609
  FileManager.prototype.onFileUploadSuccess = function (args) {
583
610
  this.uploadedCount = this.uploadedCount + args.count;
584
611
  if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
@@ -830,7 +857,9 @@ var FileManager = /** @class */ (function (_super) {
830
857
  this.dragSelectedItems.push(item.querySelector('.e-drag-text').textContent);
831
858
  }
832
859
  if (this.showItemCheckBoxes) {
833
- item.querySelector('.e-frame').classList.add('e-check');
860
+ if (item.querySelector('.e-frame')) {
861
+ item.querySelector('.e-frame').classList.add('e-check');
862
+ }
834
863
  }
835
864
  }
836
865
  }
@@ -1019,6 +1048,14 @@ var FileManager = /** @class */ (function (_super) {
1019
1048
  this.fileSystemData = newProp.fileSystemData;
1020
1049
  requiresRefresh = true;
1021
1050
  break;
1051
+ case 'navigationPaneTemplate':
1052
+ this.navigationPaneTemplate = newProp.navigationPaneTemplate;
1053
+ requiresRefresh = true;
1054
+ break;
1055
+ case 'largeIconsTemplate':
1056
+ this.largeIconsTemplate = newProp.largeIconsTemplate;
1057
+ requiresRefresh = true;
1058
+ break;
1022
1059
  }
1023
1060
  }
1024
1061
  if (requiresRefresh) {
@@ -1386,6 +1423,12 @@ var FileManager = /** @class */ (function (_super) {
1386
1423
  __decorate([
1387
1424
  Property(false)
1388
1425
  ], FileManager.prototype, "allowDragAndDrop", void 0);
1426
+ __decorate([
1427
+ Property()
1428
+ ], FileManager.prototype, "navigationPaneTemplate", void 0);
1429
+ __decorate([
1430
+ Property()
1431
+ ], FileManager.prototype, "largeIconsTemplate", void 0);
1389
1432
  __decorate([
1390
1433
  Property(true)
1391
1434
  ], FileManager.prototype, "allowMultiSelection", void 0);
@@ -1,7 +1,7 @@
1
1
  import { Component, EmitType, L10n } from '@syncfusion/ej2-base';
2
2
  import { Dialog, ButtonPropsModel } from '@syncfusion/ej2-popups';
3
3
  import { FileManagerModel } from '../base/file-manager-model';
4
- import { ToolbarSettingsModel, AjaxSettingsModel, ToolbarItemModel } from '../models/index';
4
+ import { ToolbarSettingsModel, AjaxSettingsModel, ToolbarItemModel, UploadSettingsModel } from '../models/index';
5
5
  import { DetailsViewSettingsModel } from '../models/details-view-settings-model';
6
6
  import { TreeView, ContextMenu, MenuItemModel, ItemModel } from '@syncfusion/ej2-navigations';
7
7
  import { DetailsView } from '../layout/details-view';
@@ -929,6 +929,9 @@ export interface IFileManager extends Component<HTMLElement> {
929
929
  isMac: boolean;
930
930
  oldView: string;
931
931
  oldPath: string;
932
+ navigationPaneTemplate: string | Function;
933
+ largeIconsTemplate: string | Function;
934
+ uploadSettings: UploadSettingsModel;
932
935
  }
933
936
  /** @hidden */
934
937
  export interface ITreeView extends Component<HTMLElement> {
@@ -355,6 +355,7 @@ function triggerRenameOperation(parent, data, eventArgs) {
355
355
  var oldName = fileData.name;
356
356
  fileData.name = args.newName;
357
357
  updateChildrenFilterPath(parent, fileData.id, oldName, args.newName);
358
+ parent.responseData.error = null;
358
359
  }
359
360
  else {
360
361
  var message = 'Cannot rename' + args.itemData[0].name + 'to' + args.newName + ': destination already exists.';
@@ -27,27 +27,30 @@ export declare function updatePath(node: HTMLLIElement, data: Object, instance:
27
27
  * @param {Element | Node} element - specifies the element.
28
28
  * @param {string} text - specifies the text.
29
29
  * @param {boolean} hasId - specifies the id.
30
+ * @param {IFileManager} instance - specifies the control instance.
30
31
  * @returns {string} returns the path.
31
32
  * @private
32
33
  */
33
- export declare function getPath(element: Element | Node, text: string, hasId: boolean): string;
34
+ export declare function getPath(element: Element | Node, text: string, hasId: boolean, instance?: IFileManager): string;
34
35
  /**
35
36
  * Functions for get path id in FileManager
36
37
  *
37
38
  * @param {Element} node - specifies the node element.
39
+ * @param {IFileManager} instance - specifies the control instance.
38
40
  * @returns {string[]} returns the path ids.
39
41
  * @private
40
42
  */
41
- export declare function getPathId(node: Element): string[];
43
+ export declare function getPathId(node: Element, instance?: IFileManager): string[];
42
44
  /**
43
45
  * Functions for get path names in FileManager
44
46
  *
45
47
  * @param {Element} element - specifies the node element.
46
48
  * @param {string} text - specifies the text.
49
+ * @param {IFileManager} instance - specifies the control instance.
47
50
  * @returns {string[]} returns the path names.
48
51
  * @private
49
52
  */
50
- export declare function getPathNames(element: Element, text: string): string[];
53
+ export declare function getPathNames(element: Element, text: string, instance?: IFileManager): string[];
51
54
  /**
52
55
  * Functions for get path id in FileManager
53
56
  *
@@ -55,10 +58,11 @@ export declare function getPathNames(element: Element, text: string): string[];
55
58
  * @param {string} text - specifies the text.
56
59
  * @param {boolean} isId - specifies the id.
57
60
  * @param {boolean} hasId - checks the id exists.
61
+ * @param {IFileManager} instance - specifies the control instance.
58
62
  * @returns {string[]} returns parent element.
59
63
  * @private
60
64
  */
61
- export declare function getParents(element: Element, text: string, isId: boolean, hasId?: boolean): string[];
65
+ export declare function getParents(element: Element, text: string, isId: boolean, hasId?: boolean, instance?: IFileManager): string[];
62
66
  /**
63
67
  * Functions for generate path
64
68
  *
@@ -55,9 +55,9 @@ export function updatePath(node, data, instance) {
55
55
  var text = getValue('name', data);
56
56
  var id = node.getAttribute('data-id');
57
57
  var newText = isNOU(id) ? text : id;
58
- instance.setProperties({ path: getPath(node, newText, instance.hasId) }, true);
59
- instance.pathId = getPathId(node);
60
- instance.pathNames = getPathNames(node, text);
58
+ instance.setProperties({ path: getPath(node, newText, instance.hasId, instance) }, true);
59
+ instance.pathId = getPathId(node, instance);
60
+ instance.pathNames = getPathNames(node, text, instance);
61
61
  }
62
62
  /**
63
63
  * Functions for get path in FileManager
@@ -65,11 +65,12 @@ export function updatePath(node, data, instance) {
65
65
  * @param {Element | Node} element - specifies the element.
66
66
  * @param {string} text - specifies the text.
67
67
  * @param {boolean} hasId - specifies the id.
68
+ * @param {IFileManager} instance - specifies the control instance.
68
69
  * @returns {string} returns the path.
69
70
  * @private
70
71
  */
71
- export function getPath(element, text, hasId) {
72
- var matched = getParents(element, text, false, hasId);
72
+ export function getPath(element, text, hasId, instance) {
73
+ var matched = getParents(element, text, false, hasId, instance);
73
74
  var path = '/';
74
75
  var len = matched.length - (2);
75
76
  for (var i = len; i >= 0; i--) {
@@ -81,11 +82,12 @@ export function getPath(element, text, hasId) {
81
82
  * Functions for get path id in FileManager
82
83
  *
83
84
  * @param {Element} node - specifies the node element.
85
+ * @param {IFileManager} instance - specifies the control instance.
84
86
  * @returns {string[]} returns the path ids.
85
87
  * @private
86
88
  */
87
- export function getPathId(node) {
88
- var matched = getParents(node, node.getAttribute('data-uid'), true);
89
+ export function getPathId(node, instance) {
90
+ var matched = getParents(node, node.getAttribute('data-uid'), true, false, instance);
89
91
  var ids = [];
90
92
  for (var i = matched.length - 1; i >= 0; i--) {
91
93
  ids.push(matched[i]);
@@ -97,11 +99,12 @@ export function getPathId(node) {
97
99
  *
98
100
  * @param {Element} element - specifies the node element.
99
101
  * @param {string} text - specifies the text.
102
+ * @param {IFileManager} instance - specifies the control instance.
100
103
  * @returns {string[]} returns the path names.
101
104
  * @private
102
105
  */
103
- export function getPathNames(element, text) {
104
- var matched = getParents(element, text, false);
106
+ export function getPathNames(element, text, instance) {
107
+ var matched = getParents(element, text, false, false, instance);
105
108
  var names = [];
106
109
  for (var i = matched.length - 1; i >= 0; i--) {
107
110
  names.push(matched[i]);
@@ -115,16 +118,20 @@ export function getPathNames(element, text) {
115
118
  * @param {string} text - specifies the text.
116
119
  * @param {boolean} isId - specifies the id.
117
120
  * @param {boolean} hasId - checks the id exists.
121
+ * @param {IFileManager} instance - specifies the control instance.
118
122
  * @returns {string[]} returns parent element.
119
123
  * @private
120
124
  */
121
- export function getParents(element, text, isId, hasId) {
125
+ export function getParents(element, text, isId, hasId, instance) {
122
126
  var matched = [text];
123
127
  var el = element.parentNode;
124
128
  while (!isNOU(el)) {
125
129
  if (matches(el, '.' + CLS.LIST_ITEM)) {
126
- var parentText = isId ? el.getAttribute('data-uid') : (hasId ? el.getAttribute('data-id') :
127
- select('.' + CLS.LIST_TEXT, el).textContent);
130
+ var data = [{}];
131
+ if (!isNOU(instance) && !isNOU(instance.navigationpaneModule) && !isNOU(instance.navigationpaneModule.treeObj)) {
132
+ data = instance.navigationpaneModule.treeObj.getTreeData(el);
133
+ }
134
+ var parentText = isId ? el.getAttribute('data-uid') : (hasId ? el.getAttribute('data-id') : getValue('name', data[0]));
128
135
  matched.push(parentText);
129
136
  }
130
137
  el = el.parentNode;
@@ -393,7 +400,7 @@ export function getTargetModule(parent, element) {
393
400
  tartgetModule = 'largeiconsview';
394
401
  }
395
402
  else if (element.classList.contains('e-fullrow') ||
396
- element.classList.contains('e-icon-expandable')) {
403
+ element.classList.contains('e-icon-expandable') || element.classList.contains('e-text-content')) {
397
404
  tartgetModule = 'navigationpane';
398
405
  }
399
406
  else if (closest(element, '.e-address-list-item')) {
@@ -1529,9 +1536,19 @@ export function doDownloadFiles(parent, data, newIds) {
1529
1536
  * @private
1530
1537
  */
1531
1538
  export function createDeniedDialog(parent, data, action) {
1532
- var message = getValue('message', getValue('permission', data));
1539
+ var permission = getValue('permission', data);
1540
+ var message = getValue('message', permission);
1541
+ var restriction = getValue('uploadContentFilter', permission) === 1 ? 'Folder Upload' : 'File Upload';
1533
1542
  if (message === '') {
1534
- message = getLocaleText(parent, 'Access-Message').replace('{0}', getValue('name', data)).replace('{1}', action);
1543
+ if (!isNOU(permission) && getValue('upload', permission) && getValue('uploadContentFilter', permission) === 1) {
1544
+ message = getLocaleText(parent, 'FolderUpload-Access-Message').replace('{0}', getValue('name', data)).replace('{1}', restriction);
1545
+ }
1546
+ else if (!isNOU(permission) && getValue('upload', permission) && getValue('uploadContentFilter', permission) === 2) {
1547
+ message = getLocaleText(parent, 'FileUpload-Access-Message').replace('{0}', getValue('name', data)).replace('{1}', restriction);
1548
+ }
1549
+ else {
1550
+ message = getLocaleText(parent, 'Access-Message').replace('{0}', getValue('name', data)).replace('{1}', action);
1551
+ }
1535
1552
  }
1536
1553
  var response = {
1537
1554
  error: {
@@ -169,6 +169,10 @@ var DetailsView = /** @class */ (function () {
169
169
  this.parent.toolbarModule.toolbarObj.portals) {
170
170
  this.parent['portals'] = this.parent['portals'].concat(this.parent.toolbarModule.toolbarObj.portals);
171
171
  }
172
+ if (this.parent.portals && this.parent.navigationpaneModule &&
173
+ this.parent.navigationpaneModule.treeObj && this.parent.navigationpaneModule.treeObj.portals) {
174
+ this.parent['portals'] = this.parent['portals'].concat(this.parent.navigationpaneModule.treeObj.portals);
175
+ }
172
176
  this.parent.notify('renderReactTemplate', this.parent['portals']);
173
177
  this.parent['renderReactTemplates']();
174
178
  };
@@ -246,7 +250,7 @@ var DetailsView = /** @class */ (function () {
246
250
  _loop_1(i, len);
247
251
  }
248
252
  }
249
- var iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '54' : '46');
253
+ var iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '70' : '56');
250
254
  var icon = {
251
255
  field: 'type', width: iWidth, minWidth: iWidth,
252
256
  template: initializeCSPTemplate(function (data) {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { ListBase } from '@syncfusion/ej2-lists';
2
3
  import { createElement, select, selectAll, EventHandler, KeyboardEvents, closest, Draggable, Fetch } from '@syncfusion/ej2-base';
3
4
  import { isNullOrUndefined as isNOU, addClass, removeClass, Touch, isVisible } from '@syncfusion/ej2-base';
@@ -112,6 +113,10 @@ var LargeIconsView = /** @class */ (function () {
112
113
  itemCreated: this.onItemCreated.bind(this),
113
114
  enableHtmlSanitizer: this.parent.enableHtmlSanitizer
114
115
  };
116
+ if (this.parent.largeIconsTemplate) {
117
+ this.listObj.template = this.parent.largeIconsTemplate;
118
+ this.listObj.templateID = this.parent.element.id + '_largeIconsTemplate';
119
+ }
115
120
  this.items = [];
116
121
  this.items = this.renderList(args);
117
122
  if (this.parent.sortComparer && this.parent.sortBy !== 'None') {
@@ -124,9 +129,10 @@ var LargeIconsView = /** @class */ (function () {
124
129
  if (this.parent.enableVirtualization && this.allItems.length > 0 && !isNOU(this.parent.virtualizationModule)) {
125
130
  this.parent.virtualizationModule.setUIVirtualization();
126
131
  }
127
- this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
132
+ this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj, null, null, this.parent);
128
133
  this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.listElements));
129
134
  this.element.appendChild(this.listElements);
135
+ this.parent.renderReactTemplates();
130
136
  if (this.imageEventArgsMap.size > 0) {
131
137
  this.loadImages();
132
138
  }
@@ -315,15 +321,17 @@ var LargeIconsView = /** @class */ (function () {
315
321
  };
316
322
  LargeIconsView.prototype.onItemCreated = function (args) {
317
323
  args.item.removeAttribute('aria-level');
318
- if (!this.parent.showFileExtension && getValue('isFile', args.curData)) {
319
- var textEle = args.item.querySelector('.' + CLS.LIST_TEXT);
320
- var txt = getValue('name', args.curData);
321
- var type = getValue('type', args.curData);
322
- if (txt.indexOf(type) !== -1) {
323
- textEle.innerHTML = txt.substr(0, txt.length - type.length);
324
+ if (!this.parent.largeIconsTemplate) {
325
+ if (!this.parent.showFileExtension && getValue('isFile', args.curData)) {
326
+ var textEle = args.item.querySelector('.' + CLS.LIST_TEXT);
327
+ var txt = getValue('name', args.curData);
328
+ var type = getValue('type', args.curData);
329
+ if (txt.indexOf(type) !== -1) {
330
+ textEle.innerHTML = txt.substr(0, txt.length - type.length);
331
+ }
324
332
  }
333
+ this.renderCheckbox(args);
325
334
  }
326
- this.renderCheckbox(args);
327
335
  var eventArgs = {
328
336
  element: args.item,
329
337
  fileDetails: args.curData,
@@ -961,8 +969,7 @@ var LargeIconsView = /** @class */ (function () {
961
969
  }
962
970
  };
963
971
  LargeIconsView.prototype.updateType = function (item) {
964
- var folder = select('.' + CLS.FOLDER, item);
965
- this.parent.isFile = isNOU(folder) ? true : false;
972
+ this.parent.isFile = getValue('isFile', this.getItemObject(item));
966
973
  };
967
974
  /* istanbul ignore next */
968
975
  LargeIconsView.prototype.keydownActionHandler = function (e) {
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { TreeView as BaseTreeView } from '@syncfusion/ej2-navigations';
2
13
  import { isNullOrUndefined as isNOU, select, setValue, getValue, Draggable } from '@syncfusion/ej2-base';
3
14
  import { KeyboardEvents, closest } from '@syncfusion/ej2-base';
@@ -69,10 +80,7 @@ var NavigationPane = /** @class */ (function () {
69
80
  setValue('_fm_htmlAttr', attr, rootData);
70
81
  }
71
82
  this.treeObj = new BaseTreeView({
72
- fields: {
73
- dataSource: [rootData], id: '_fm_id', parentID: '_fm_pId', expanded: '_fm_expanded', selected: '_fm_selected', text: 'name',
74
- hasChildren: 'hasChild', iconCss: '_fm_icon', htmlAttributes: '_fm_htmlAttr', tooltip: 'name'
75
- },
83
+ fields: __assign({ dataSource: [rootData], id: '_fm_id', parentID: '_fm_pId', expanded: '_fm_expanded', selected: '_fm_selected', text: 'name', hasChildren: 'hasChild' }, (isNOU(this.parent.navigationPaneTemplate) && { iconCss: '_fm_icon' }), { htmlAttributes: '_fm_htmlAttr', tooltip: 'name' }),
76
84
  enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
77
85
  sortOrder: this.parent.navigationPaneSettings.sortOrder,
78
86
  nodeSelecting: this.onNodeSelecting.bind(this),
@@ -83,7 +91,8 @@ var NavigationPane = /** @class */ (function () {
83
91
  nodeEditing: this.onNodeEditing.bind(this),
84
92
  drawNode: this.onDrowNode.bind(this),
85
93
  enableRtl: this.parent.enableRtl,
86
- dataBound: this.addDragDrop.bind(this)
94
+ dataBound: this.addDragDrop.bind(this),
95
+ nodeTemplate: this.parent.navigationPaneTemplate
87
96
  });
88
97
  this.treeObj.isStringTemplate = true;
89
98
  this.treeObj.appendTo('#' + this.parent.element.id + CLS.TREE_ID);
@@ -95,7 +104,7 @@ var NavigationPane = /** @class */ (function () {
95
104
  if (this.parent.allowDragAndDrop && isNOU(this.dragObj)) {
96
105
  this.dragObj = new Draggable(this.treeObj.element, {
97
106
  cursorAt: this.parent.dragCursorPosition,
98
- dragTarget: '.' + CLS.FULLROW,
107
+ dragTarget: '.' + CLS.FULLROW + ',.' + CLS.TEXT_CONTENT,
99
108
  distance: 5,
100
109
  dragArea: this.parent.element,
101
110
  drag: draggingHandler.bind(this, this.parent),
@@ -116,7 +125,7 @@ var NavigationPane = /** @class */ (function () {
116
125
  };
117
126
  NavigationPane.prototype.dragHelper = function (args) {
118
127
  var dragTarget = args.sender.target;
119
- if (!dragTarget.classList.contains(CLS.FULLROW)) {
128
+ if (!dragTarget.classList.contains(CLS.FULLROW) && !dragTarget.classList.contains(CLS.TEXT_CONTENT)) {
120
129
  return null;
121
130
  }
122
131
  var dragLi = closest(dragTarget, 'li');
@@ -139,7 +148,7 @@ var NavigationPane = /** @class */ (function () {
139
148
  NavigationPane.prototype.getDropPath = function (node, text) {
140
149
  var id = node.getAttribute('data-id');
141
150
  var newText = this.parent.hasId ? id : text;
142
- return getPath(node, newText, this.parent.hasId);
151
+ return getPath(node, newText, this.parent.hasId, this.parent);
143
152
  };
144
153
  NavigationPane.prototype.onDrowNode = function (args) {
145
154
  var eventArgs = {
@@ -148,6 +157,16 @@ var NavigationPane = /** @class */ (function () {
148
157
  module: 'NavigationPane'
149
158
  };
150
159
  this.parent.trigger('fileLoad', eventArgs);
160
+ if (this.parent && this.parent.portals && this.treeObj && this.treeObj.portals) {
161
+ for (var i = 0; i < this.treeObj.portals.length; i++) {
162
+ if (this.parent.portals.indexOf(this.treeObj.portals[i]) === -1) {
163
+ this.parent.portals.push(this.treeObj.portals[i]);
164
+ }
165
+ }
166
+ if (this.parent.isReact) {
167
+ this.parent.renderReactTemplates();
168
+ }
169
+ }
151
170
  };
152
171
  NavigationPane.prototype.addChild = function (files, target, prevent) {
153
172
  var directories = getDirectories(files);
@@ -248,7 +267,7 @@ var NavigationPane = /** @class */ (function () {
248
267
  }
249
268
  this.parent.searchedItems = [];
250
269
  if (!args.isInteracted && !this.isRightClick && !this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent) {
251
- this.parent.pathId = getPathId(args.node);
270
+ this.parent.pathId = getPathId(args.node, this.parent);
252
271
  return;
253
272
  }
254
273
  this.activeNode = args.node;
@@ -261,7 +280,7 @@ var NavigationPane = /** @class */ (function () {
261
280
  updatePath(args.node, this.parent.itemData[0], this.parent);
262
281
  }
263
282
  else {
264
- this.parent.pathId = getPathId(args.node);
283
+ this.parent.pathId = getPathId(args.node, this.parent);
265
284
  this.parent.visitedItem = args.node;
266
285
  }
267
286
  if (args.node.querySelector('.' + CLS.ICONS) && args.node.querySelector('.' + CLS.LIST_ITEM) === null) {
@@ -287,11 +306,11 @@ var NavigationPane = /** @class */ (function () {
287
306
  }
288
307
  if (args.node.querySelector('.' + CLS.LIST_ITEM) === null) {
289
308
  this.isNodeExpandCalled = true;
290
- var text = getValue('text', args.nodeData);
309
+ var nodeData = this.getTreeData(getValue('id', args.nodeData));
291
310
  var id = args.node.getAttribute('data-id');
292
311
  var isId = isNOU(id) ? false : true;
293
- var newText = isNOU(id) ? text : id;
294
- var path = getPath(args.node, newText, isId);
312
+ var newText = isNOU(id) ? nodeData[0].name : id;
313
+ var path = getPath(args.node, newText, isId, this.parent);
295
314
  this.expandNodeTarget = args.node.getAttribute('data-uid');
296
315
  this.parent.expandedId = this.expandNodeTarget;
297
316
  this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
@@ -47,6 +47,8 @@ export var defaultLocale = {
47
47
  'None': 'None',
48
48
  'View-LargeIcons': 'Large icons',
49
49
  'View-Details': 'Details',
50
+ 'Upload-File': 'File',
51
+ 'Upload-Folder': 'Folder',
50
52
  'Search': 'Search',
51
53
  'Button-Ok': 'OK',
52
54
  'Button-Cancel': 'Cancel',
@@ -95,6 +97,8 @@ export var defaultLocale = {
95
97
  'ApplyAll-Label': 'Do this for all current items',
96
98
  'KB': 'KB',
97
99
  'Access-Message': '{0} is not accessible. You need permission to perform the {1} action.',
100
+ 'FolderUpload-Access-Message': '{0} is not accessible. you need permission to perform the {1} action.',
101
+ 'FileUpload-Access-Message': '{0} is not accessible. you need permission to perform the {1} action.',
98
102
  'Network-Error': 'NetworkError: Failed to send on XMLHTTPRequest: Failed to load',
99
103
  'Server-Error': 'ServerError: Invalid response from'
100
104
  };