@syncfusion/ej2-filemanager 21.2.5 → 22.1.34

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 (71) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +9 -0
  3. package/dist/ej2-filemanager.min.js +2 -2
  4. package/dist/ej2-filemanager.umd.min.js +2 -2
  5. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-filemanager.es2015.js +52 -18
  7. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  8. package/dist/es6/ej2-filemanager.es5.js +51 -18
  9. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  10. package/dist/global/ej2-filemanager.min.js +2 -2
  11. package/dist/global/ej2-filemanager.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +15 -15
  14. package/src/file-manager/base/file-manager-model.d.ts +7 -0
  15. package/src/file-manager/base/file-manager.d.ts +6 -0
  16. package/src/file-manager/base/file-manager.js +3 -0
  17. package/src/file-manager/base/interface.d.ts +49 -134
  18. package/src/file-manager/common/operations.js +16 -2
  19. package/src/file-manager/common/utility.d.ts +2 -2
  20. package/src/file-manager/common/utility.js +8 -3
  21. package/src/file-manager/layout/details-view.js +14 -10
  22. package/src/file-manager/layout/large-icons-view.js +2 -2
  23. package/src/file-manager/models/column-model.d.ts +4 -2
  24. package/src/file-manager/models/column.d.ts +4 -2
  25. package/src/file-manager/models/details-view-settings-model.d.ts +1 -1
  26. package/src/file-manager/models/details-view-settings.js +9 -3
  27. package/src/file-manager/models/search-settings.d.ts +6 -13
  28. package/src/file-manager/pop-up/dialog.js +1 -0
  29. package/styles/bootstrap-dark.css +5 -1
  30. package/styles/bootstrap.css +5 -1
  31. package/styles/bootstrap4.css +5 -1
  32. package/styles/bootstrap5-dark.css +5 -1
  33. package/styles/bootstrap5.css +5 -1
  34. package/styles/fabric-dark.css +5 -1
  35. package/styles/fabric.css +5 -1
  36. package/styles/file-manager/_layout.scss +143 -43
  37. package/styles/file-manager/_material3-dark-definition.scss +1 -0
  38. package/styles/file-manager/_material3-definition.scss +260 -0
  39. package/styles/file-manager/_theme.scss +27 -24
  40. package/styles/file-manager/bootstrap-dark.css +5 -1
  41. package/styles/file-manager/bootstrap.css +5 -1
  42. package/styles/file-manager/bootstrap4.css +5 -1
  43. package/styles/file-manager/bootstrap5-dark.css +5 -1
  44. package/styles/file-manager/bootstrap5.css +5 -1
  45. package/styles/file-manager/fabric-dark.css +5 -1
  46. package/styles/file-manager/fabric.css +5 -1
  47. package/styles/file-manager/fluent-dark.css +5 -1
  48. package/styles/file-manager/fluent.css +5 -1
  49. package/styles/file-manager/highcontrast-light.css +5 -1
  50. package/styles/file-manager/highcontrast.css +5 -1
  51. package/styles/file-manager/icons/_material3-dark.scss +1 -0
  52. package/styles/file-manager/material-dark.css +5 -1
  53. package/styles/file-manager/material.css +5 -1
  54. package/styles/file-manager/material3-dark.css +1621 -0
  55. package/styles/file-manager/material3-dark.scss +17 -0
  56. package/styles/file-manager/material3.css +1677 -0
  57. package/styles/file-manager/material3.scss +17 -0
  58. package/styles/file-manager/tailwind-dark.css +5 -1
  59. package/styles/file-manager/tailwind.css +5 -1
  60. package/styles/fluent-dark.css +5 -1
  61. package/styles/fluent.css +5 -1
  62. package/styles/highcontrast-light.css +5 -1
  63. package/styles/highcontrast.css +5 -1
  64. package/styles/material-dark.css +5 -1
  65. package/styles/material.css +5 -1
  66. package/styles/material3-dark.css +1621 -0
  67. package/styles/material3-dark.scss +3 -0
  68. package/styles/material3.css +1677 -0
  69. package/styles/material3.scss +3 -0
  70. package/styles/tailwind-dark.css +5 -1
  71. package/styles/tailwind.css +5 -1
@@ -1,4 +1,4 @@
1
- import { Ajax, Browser, ChildProperty, Complex, Component, Draggable, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, createElement, detach, extend, formatUnit, getUniqueID, getValue, isNullOrUndefined, isVisible, matches, remove, removeClass, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
1
+ import { Ajax, Browser, ChildProperty, Complex, Component, Draggable, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, createElement, detach, extend, formatUnit, getUniqueID, getValue, initializeCSPTemplate, isNullOrUndefined, isVisible, matches, remove, removeClass, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
2
  import { Splitter } from '@syncfusion/ej2-layouts';
3
3
  import { Dialog, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
4
4
  import { DataManager, Query } from '@syncfusion/ej2-data';
@@ -89,14 +89,20 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
89
89
  const columnArray = [
90
90
  {
91
91
  field: 'name', headerText: 'Name', minWidth: 120, isPrimaryKey: true,
92
- template: '<span class="e-fe-text">${name}</span>', customAttributes: { class: 'e-fe-grid-name' }
92
+ template: initializeCSPTemplate(function (data) {
93
+ return `<span class="e-fe-text">${data.name}</span>`;
94
+ }),
95
+ customAttributes: { class: 'e-fe-grid-name' }
93
96
  },
94
97
  {
95
98
  field: '_fm_modified', headerText: 'DateModified', type: 'dateTime',
96
99
  format: 'MMMM dd, yyyy HH:mm', minWidth: 120, width: '190'
97
100
  },
98
101
  {
99
- field: 'size', headerText: 'Size', minWidth: 90, width: '110', template: '<span class="e-fe-size">${size}</span>', format: 'n2'
102
+ field: 'size', headerText: 'Size', minWidth: 90, width: '110',
103
+ template: initializeCSPTemplate(function (data) {
104
+ return `<span class="e-fe-size">${data.size}</span>`;
105
+ }), format: 'n2'
100
106
  }
101
107
  ];
102
108
  /**
@@ -1264,10 +1270,15 @@ function setNodeId(result, rootId) {
1264
1270
  * @private
1265
1271
  */
1266
1272
  // eslint-disable-next-line
1267
- function setDateObject(args) {
1273
+ function setDateObject(args, localeString, dateFormat) {
1268
1274
  for (let i = 0; i < args.length; i++) {
1269
- setValue('_fm_created', new Date(getValue('dateCreated', args[i])), args[i]);
1270
- setValue('_fm_modified', new Date(getValue('dateModified', args[i])), args[i]);
1275
+ const createdDate = new Date(getValue('dateCreated', args[i]));
1276
+ const modifiedDate = new Date(getValue('dateModified', args[i]));
1277
+ if (isNullOrUndefined(dateFormat)) {
1278
+ dateFormat = "MM/dd/yyyy";
1279
+ }
1280
+ setValue('_fm_created', localeString.formatDate(createdDate, { format: dateFormat }), args[i]);
1281
+ setValue('_fm_modified', localeString.formatDate(modifiedDate, { format: dateFormat }), args[i]);
1271
1282
  }
1272
1283
  }
1273
1284
  /**
@@ -2298,6 +2309,19 @@ function GetDetails(parent, names, path, operation) {
2298
2309
  * @returns {void}
2299
2310
  * @private
2300
2311
  */
2312
+ function getDateFormat(parent) {
2313
+ const columns = parent.detailsViewSettings.columns;
2314
+ let dateFormat;
2315
+ for (var i = 0; i < columns.length; i++) {
2316
+ if (columns[i].field === '_fm_modified') {
2317
+ if (!isNullOrUndefined(columns[i].format)) {
2318
+ dateFormat = columns[i].format.toString();
2319
+ }
2320
+ break;
2321
+ }
2322
+ }
2323
+ return dateFormat;
2324
+ }
2301
2325
  function createAjax(
2302
2326
  // eslint-disable-next-line
2303
2327
  parent, data, fn, event, operation, targetPath) {
@@ -2359,8 +2383,9 @@ parent, data, fn, event, operation, targetPath) {
2359
2383
  }
2360
2384
  }
2361
2385
  }
2386
+ const intl = new Internationalization(parent.locale);
2362
2387
  if (!isNullOrUndefined(result.files)) {
2363
- setDateObject(result.files);
2388
+ setDateObject(result.files, intl, getDateFormat(parent));
2364
2389
  for (let i = 0, len = result.files.length; i < len; i++) {
2365
2390
  // eslint-disable-next-line
2366
2391
  const item = result.files[i];
@@ -3583,6 +3608,7 @@ function onReSubmit(parent) {
3583
3608
  const newPath = (parent.activeModule === 'navigationpane') ? getValue('filterPath', parent.itemData[0]).replace(/\\/g, '/') : parent.path;
3584
3609
  parent.renamedId = getValue('id', parent.itemData[0]);
3585
3610
  parent.renamedId = getValue('id', parent.itemData[0]);
3611
+ parent.renamedId = getValue('id', parent.itemData[0]);
3586
3612
  if (parent.isFile) {
3587
3613
  const oldExtension = (oIndex === -1) ? '' : parent.currentItemText.substr(oIndex);
3588
3614
  const nIndex = text.lastIndexOf('.');
@@ -4028,7 +4054,7 @@ class LargeIconsView {
4028
4054
  this.parent.trigger('fileLoad', eventArgs);
4029
4055
  }
4030
4056
  renderCheckbox(args) {
4031
- if (!this.parent.allowMultiSelection) {
4057
+ if (!this.parent.showItemCheckBoxes) {
4032
4058
  return;
4033
4059
  }
4034
4060
  const checkElement = createCheckBox(createElement, false, {
@@ -5088,7 +5114,7 @@ class LargeIconsView {
5088
5114
  item.focus();
5089
5115
  }
5090
5116
  checkState(item, toCheck) {
5091
- if (!this.parent.allowMultiSelection) {
5117
+ if (!this.parent.showItemCheckBoxes) {
5092
5118
  return;
5093
5119
  }
5094
5120
  const checkEle = select('.' + FRAME, item);
@@ -7574,6 +7600,9 @@ __decorate$8([
7574
7600
  __decorate$8([
7575
7601
  Property(true)
7576
7602
  ], FileManager.prototype, "allowMultiSelection", void 0);
7603
+ __decorate$8([
7604
+ Property(true)
7605
+ ], FileManager.prototype, "showItemCheckBoxes", void 0);
7577
7606
  __decorate$8([
7578
7607
  Complex({}, ContextMenuSettings)
7579
7608
  ], FileManager.prototype, "contextMenuSettings", void 0);
@@ -9512,13 +9541,15 @@ class DetailsView {
9512
9541
  columns = [
9513
9542
  {
9514
9543
  field: 'name', headerText: getLocaleText(this.parent, 'Name'), width: 'auto', minWidth: 120, headerTextAlign: 'Left',
9515
- template: '<div class="e-fe-text">${name}</div><div class="e-fe-date">${_fm_modified}</div>' +
9516
- '<span class="e-fe-size">${size}</span>'
9544
+ template: initializeCSPTemplate(function (data) {
9545
+ return `<div class="e-fe-text">${data.name}</div><div class="e-fe-date">${data._fm_modified}</div>' +
9546
+ '<span class="e-fe-size">${data.size}</span>`;
9547
+ })
9517
9548
  }
9518
9549
  ];
9519
9550
  }
9520
9551
  else {
9521
- columns = JSON.parse(JSON.stringify(this.parent.detailsViewSettings.columns));
9552
+ columns = extend([], this.parent.detailsViewSettings.columns, null, true);
9522
9553
  this.adjustWidth(columns, 'name');
9523
9554
  for (let i = 0, len = columns.length; i < len; i++) {
9524
9555
  columns[i].headerText = getLocaleText(this.parent, columns[i].headerText);
@@ -9526,12 +9557,16 @@ class DetailsView {
9526
9557
  }
9527
9558
  const iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '54' : '46');
9528
9559
  const icon = {
9529
- field: 'type', width: iWidth, minWidth: iWidth, template: '<span class="e-fe-icon ${_fm_iconClass}"></span>',
9530
- allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
9531
- headerTemplate: '<span class="e-fe-icon e-fe-folder"></span>'
9560
+ field: 'type', width: iWidth, minWidth: iWidth,
9561
+ template: initializeCSPTemplate(function (data) {
9562
+ return `<span class="e-fe-icon ${data._fm_iconClass}"></span>`;
9563
+ }), allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
9564
+ headerTemplate: initializeCSPTemplate(function () {
9565
+ return `<span class="e-fe-icon e-fe-folder"></span>`;
9566
+ }),
9532
9567
  };
9533
9568
  columns.unshift(icon);
9534
- if (this.parent.allowMultiSelection) {
9569
+ if (this.parent.showItemCheckBoxes) {
9535
9570
  const cWidth = (this.parent.isBigger ? '36' : '26');
9536
9571
  const cBox = {
9537
9572
  type: 'checkbox', width: cWidth, minWidth: cWidth, customAttributes: { class: 'e-fe-checkbox' },
@@ -9611,8 +9646,6 @@ class DetailsView {
9611
9646
  }
9612
9647
  }
9613
9648
  let value = intl.formatNumber((sizeValue / 1024), { format: sizeFormat });
9614
- let num = Number(value.replace(/,/g, ''));
9615
- value = num.toLocaleString(intl.culture);
9616
9649
  modifiedSize = value + ' ' + getLocaleText(this.parent, 'KB');
9617
9650
  }
9618
9651
  sizeEle.innerHTML = modifiedSize;
@@ -10673,6 +10706,7 @@ class DetailsView {
10673
10706
  let lastItem;
10674
10707
  switch (action) {
10675
10708
  case 'altEnter':
10709
+ this.parent.notify(detailsInit, {});
10676
10710
  GetDetails(this.parent, this.parent.selectedItems, this.parent.path, 'details');
10677
10711
  break;
10678
10712
  case 'esc':