@syncfusion/ej2-filemanager 33.2.3 → 33.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 33.2.3
3
+ * version : 33.2.6
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-filemanager",
3
- "version": "33.2.3",
3
+ "version": "33.2.6",
4
4
  "description": "Essential JS 2 FileManager Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -9,15 +9,15 @@
9
9
  "es2015": "./dist/es6/ej2-filemanager.es5.js",
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~33.2.3",
12
- "@syncfusion/ej2-buttons": "~33.2.3",
13
- "@syncfusion/ej2-data": "~33.2.3",
14
- "@syncfusion/ej2-grids": "~33.2.3",
15
- "@syncfusion/ej2-inputs": "~33.2.3",
12
+ "@syncfusion/ej2-buttons": "~33.2.5",
13
+ "@syncfusion/ej2-data": "~33.2.5",
14
+ "@syncfusion/ej2-grids": "~33.2.5",
15
+ "@syncfusion/ej2-inputs": "~33.2.5",
16
16
  "@syncfusion/ej2-layouts": "~33.2.3",
17
17
  "@syncfusion/ej2-lists": "~33.2.3",
18
- "@syncfusion/ej2-navigations": "~33.2.3",
19
- "@syncfusion/ej2-popups": "~33.2.3",
20
- "@syncfusion/ej2-splitbuttons": "~33.2.3"
18
+ "@syncfusion/ej2-navigations": "~33.2.6",
19
+ "@syncfusion/ej2-popups": "~33.2.5",
20
+ "@syncfusion/ej2-splitbuttons": "~33.2.6"
21
21
  },
22
22
  "devDependencies": {},
23
23
  "keywords": [
@@ -13,6 +13,10 @@ export declare class BreadCrumbBar {
13
13
  private searchTimer;
14
14
  private keyConfigs;
15
15
  private searchWrapWidth;
16
+ private boundSearchChangeHandler;
17
+ private boundOnKeyUp;
18
+ private searchIcon;
19
+ private searchSibling;
16
20
  /**
17
21
  * constructor for addressbar module
18
22
  *
@@ -24,6 +28,7 @@ export declare class BreadCrumbBar {
24
28
  constructor(parent?: IFileManager);
25
29
  private onPropertyChanged;
26
30
  private render;
31
+ private setBreadcrumbNavAttributes;
27
32
  onPathChange(): void;
28
33
  private updateBreadCrumbBar;
29
34
  private onFocus;
@@ -23,10 +23,14 @@ var BreadCrumbBar = /** @class */ (function () {
23
23
  this.addressBarLink = '';
24
24
  this.searchTimer = null;
25
25
  this.searchWrapWidth = null;
26
+ this.searchIcon = null;
27
+ this.searchSibling = null;
26
28
  this.parent = parent;
27
29
  this.keyConfigs = {
28
30
  enter: 'enter'
29
31
  };
32
+ this.boundSearchChangeHandler = this.searchChangeHandler.bind(this);
33
+ this.boundOnKeyUp = this.onKeyUp.bind(this);
30
34
  this.render();
31
35
  }
32
36
  BreadCrumbBar.prototype.onPropertyChanged = function (e) {
@@ -51,8 +55,15 @@ var BreadCrumbBar = /** @class */ (function () {
51
55
  }
52
56
  };
53
57
  BreadCrumbBar.prototype.render = function () {
58
+ this.setBreadcrumbNavAttributes();
54
59
  this.addEventListener();
55
60
  };
61
+ BreadCrumbBar.prototype.setBreadcrumbNavAttributes = function () {
62
+ var navElement = this.parent && this.parent.breadCrumbNavElement;
63
+ if (navElement) {
64
+ navElement.setAttribute('aria-label', 'Breadcrumb');
65
+ }
66
+ };
56
67
  BreadCrumbBar.prototype.onPathChange = function () {
57
68
  var pathNames = this.parent.pathNames;
58
69
  var paths = this.parent.path.split('/');
@@ -73,7 +84,6 @@ var BreadCrumbBar = /** @class */ (function () {
73
84
  addressbarLI.appendChild(icon);
74
85
  }
75
86
  addressbarLI.setAttribute('tabindex', '0');
76
- addressbarLI.setAttribute('role', 'link');
77
87
  var pathLabel = pathNames.slice(0, i + 1).join(' / ');
78
88
  addressbarLI.setAttribute('aria-label', pathLabel);
79
89
  if (pathNamesLen - i === 1) {
@@ -81,24 +91,24 @@ var BreadCrumbBar = /** @class */ (function () {
81
91
  }
82
92
  id = '';
83
93
  addressATag = createElement('a', { className: CLS.LIST_TEXT });
84
- addressATag.setAttribute('role', 'presentation');
94
+ addressATag.setAttribute('role', 'link');
85
95
  addressATag.innerText = pathNames[i];
86
96
  addressbarLI.appendChild(addressATag);
87
97
  addressbarUL.appendChild(addressbarLI);
88
98
  }
89
- var ulElement = this.parent.breadCrumbBarNavigation.querySelector('.e-addressbar-ul');
99
+ var ulElement = this.parent.breadCrumbNavElement.querySelector('.e-addressbar-ul');
90
100
  if (!isNullOrUndefined(ulElement)) {
91
101
  if (!isNullOrUndefined(this.subMenuObj)) {
92
102
  this.subMenuObj.destroy();
93
103
  }
94
104
  remove(ulElement);
95
105
  }
96
- var searchWrap = this.parent.breadCrumbBarNavigation.querySelector('.e-search-wrap');
106
+ var searchWrap = this.parent.breadCrumbNavElement.querySelector('.e-search-wrap');
97
107
  if (!searchWrap) {
98
- this.parent.breadCrumbBarNavigation.insertBefore(addressbarUL, searchWrap);
108
+ this.parent.breadCrumbNavElement.insertBefore(addressbarUL, searchWrap);
99
109
  }
100
110
  else {
101
- this.parent.breadCrumbBarNavigation.appendChild(addressbarUL);
111
+ this.parent.breadCrumbNavElement.appendChild(addressbarUL);
102
112
  }
103
113
  this.updateBreadCrumbBar(addressbarUL);
104
114
  }
@@ -106,7 +116,7 @@ var BreadCrumbBar = /** @class */ (function () {
106
116
  /* istanbul ignore next */
107
117
  BreadCrumbBar.prototype.updateBreadCrumbBar = function (addresBarUL) {
108
118
  var liElements = addresBarUL.querySelectorAll('li');
109
- var ulElement = this.parent.breadCrumbBarNavigation.querySelector('.e-addressbar-ul');
119
+ var ulElement = this.parent.breadCrumbNavElement.querySelector('.e-addressbar-ul');
110
120
  var style = window.getComputedStyle(ulElement, null);
111
121
  var pRight = parseFloat(style.getPropertyValue('padding-right'));
112
122
  var pLeft = parseFloat(style.getPropertyValue('padding-left'));
@@ -128,12 +138,12 @@ var BreadCrumbBar = /** @class */ (function () {
128
138
  var searchInput = createElement('input', { id: id,
129
139
  attrs: { autocomplete: 'off', 'aria-label': getLocaleText(this.parent, 'Search') } });
130
140
  searchContainer.appendChild(searchInput);
131
- var searchEle = this.parent.breadCrumbBarNavigation.querySelector('.e-search-wrap .e-input');
141
+ var searchEle = this.parent.breadCrumbNavElement.querySelector('.e-search-wrap .e-input');
132
142
  if (isNullOrUndefined(searchEle)) {
133
- this.parent.breadCrumbBarNavigation.appendChild(searchContainer);
134
- var span = createElement('span', { className: 'e-icons e-fe-search' });
135
- EventHandler.add(span, 'click', this.onShowInput, this);
136
- searchInput.parentElement.insertBefore(span, searchInput);
143
+ this.parent.breadCrumbNavElement.appendChild(searchContainer);
144
+ this.searchIcon = createElement('span', { className: 'e-icons e-fe-search' });
145
+ EventHandler.add(this.searchIcon, 'click', this.onShowInput, this);
146
+ searchInput.parentElement.insertBefore(this.searchIcon, searchInput);
137
147
  this.searchObj = new TextBox({
138
148
  value: '',
139
149
  showClearButton: true,
@@ -143,11 +153,11 @@ var BreadCrumbBar = /** @class */ (function () {
143
153
  });
144
154
  this.searchObj.appendTo('#' + this.parent.element.id + CLS.SEARCH_ID);
145
155
  this.searchEventBind(this.parent.searchSettings.allowSearchOnTyping);
146
- var search = this.searchObj.element.nextElementSibling;
147
- EventHandler.add(search, 'mousedown', this.searchChangeHandler.bind(this), this);
148
- EventHandler.add(this.searchObj.element, 'keyup', this.onKeyUp.bind(this), this);
156
+ this.searchSibling = this.searchObj.element.nextElementSibling;
157
+ EventHandler.add(this.searchSibling, 'mousedown', this.boundSearchChangeHandler, this);
158
+ EventHandler.add(this.searchObj.element, 'keyup', this.boundOnKeyUp, this);
149
159
  }
150
- var searchWrap = this.parent.breadCrumbBarNavigation.querySelector('.e-search-wrap');
160
+ var searchWrap = this.parent.breadCrumbNavElement.querySelector('.e-search-wrap');
151
161
  breadCrumbBarWidth = breadCrumbBarWidth - (this.searchWrapWidth ? this.searchWrapWidth : searchWrap.offsetWidth);
152
162
  if (liElementsWidth > breadCrumbBarWidth) {
153
163
  var i = liElements.length;
@@ -185,10 +195,10 @@ var BreadCrumbBar = /** @class */ (function () {
185
195
  break;
186
196
  }
187
197
  }
188
- this.parent.breadCrumbBarNavigation.insertBefore(addressbarUL, searchWrap);
198
+ this.parent.breadCrumbNavElement.insertBefore(addressbarUL, searchWrap);
189
199
  }
190
200
  else {
191
- this.parent.breadCrumbBarNavigation.insertBefore(addresBarUL, searchWrap);
201
+ this.parent.breadCrumbNavElement.insertBefore(addresBarUL, searchWrap);
192
202
  }
193
203
  };
194
204
  /* istanbul ignore next */
@@ -267,7 +277,7 @@ var BreadCrumbBar = /** @class */ (function () {
267
277
  this.searchWrapWidth = null;
268
278
  }
269
279
  else {
270
- var searchWrap = this.parent.breadCrumbBarNavigation.querySelector('.e-search-wrap');
280
+ var searchWrap = this.parent.breadCrumbNavElement.querySelector('.e-search-wrap');
271
281
  this.searchWrapWidth = searchWrap.offsetWidth;
272
282
  addClass([this.parent.element], CLS.FILTER);
273
283
  this.searchObj.element.focus();
@@ -368,6 +378,18 @@ var BreadCrumbBar = /** @class */ (function () {
368
378
  this.parent.off(events.dropInit, this.onDropInit);
369
379
  this.parent.off(events.layoutRefresh, this.onResize);
370
380
  this.parent.off(events.dropPath, this.onPathChange);
381
+ if (this.parent.breadCrumbBarNavigation) {
382
+ EventHandler.remove(this.parent.breadCrumbBarNavigation, 'click', this.addressPathClickHandler);
383
+ }
384
+ if (this.searchIcon) {
385
+ EventHandler.remove(this.searchIcon, 'click', this.onShowInput);
386
+ }
387
+ if (this.searchSibling) {
388
+ EventHandler.remove(this.searchSibling, 'mousedown', this.boundSearchChangeHandler);
389
+ }
390
+ if (this.searchObj && this.searchObj.element) {
391
+ EventHandler.remove(this.searchObj.element, 'keyup', this.boundOnKeyUp);
392
+ }
371
393
  };
372
394
  /* istanbul ignore next */
373
395
  BreadCrumbBar.prototype.onDropInit = function (args) {
@@ -119,6 +119,7 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
119
119
  splitterObj: Splitter;
120
120
  persistData: boolean;
121
121
  breadCrumbBarNavigation: HTMLElement;
122
+ breadCrumbNavElement: HTMLElement;
122
123
  localeObj: L10n;
123
124
  uploadObj: Uploader;
124
125
  uploadDialogObj: Dialog;
@@ -158,6 +159,8 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
158
159
  private dragX;
159
160
  private dragY;
160
161
  private dragSelectedItems;
162
+ private lastDragEvent;
163
+ private dragContainer;
161
164
  /**
162
165
  * Specifies the AJAX settings of the file manager.
163
166
  *
@@ -709,6 +712,7 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
709
712
  private onScrollHandler;
710
713
  private onDragStart;
711
714
  private onDrag;
715
+ private onDragScroll;
712
716
  private onDragStop;
713
717
  private selectItems;
714
718
  private onLayoutChange;
@@ -289,6 +289,8 @@ var FileManager = /** @class */ (function (_super) {
289
289
  id: this.element.id + CLS.BREADCRUMBBAR_ID,
290
290
  className: CLS.BREADCRUMBS
291
291
  });
292
+ this.breadCrumbNavElement = this.createElement('nav');
293
+ this.breadCrumbBarNavigation.appendChild(this.breadCrumbNavElement);
292
294
  contentWrap.appendChild(this.breadCrumbBarNavigation);
293
295
  var gridWrap = this.createElement('div', {
294
296
  id: this.element.id + CLS.GRID_ID
@@ -788,41 +790,74 @@ var FileManager = /** @class */ (function (_super) {
788
790
  return;
789
791
  }
790
792
  }
793
+ var contentElem = this.viewElem.firstChild;
794
+ var isLargeIcons = this.viewElem.classList.contains('e-large-icons');
795
+ if (isLargeIcons) {
796
+ this.dragContainer = (contentElem && contentElem.tagName === 'UL') ? contentElem : this.viewElem;
797
+ }
798
+ else {
799
+ this.dragContainer = this.viewElem.firstChild;
800
+ }
801
+ if (!this.dragContainer) {
802
+ return;
803
+ }
791
804
  event.preventDefault();
792
- this.dragX = event.pageX;
793
- this.dragY = event.pageY;
805
+ this.lastDragEvent = event;
806
+ var ulRect = this.dragContainer.getBoundingClientRect();
807
+ this.dragX = event.clientX - ulRect.left - this.dragContainer.clientLeft + this.dragContainer.scrollLeft;
808
+ this.dragY = event.clientY - ulRect.top - this.dragContainer.clientTop + this.dragContainer.scrollTop;
794
809
  if (!this.dragSelectElement) {
795
810
  this.dragSelectElement = createElement('div', {
796
811
  id: this.element.id + '_drag',
797
- className: 'e-filemanager e-drag-select',
798
- styles: 'left: ' + this.dragX + 'px;top: ' + this.dragY + 'px;'
812
+ className: 'e-filemanager e-drag-select'
813
+ });
814
+ setStyleAttribute(this.dragSelectElement, {
815
+ position: 'absolute',
816
+ left: this.dragX + 'px',
817
+ top: this.dragY + 'px',
818
+ width: '0px',
819
+ height: '0px',
820
+ pointerEvents: 'none'
799
821
  });
800
- document.body.append(this.dragSelectElement);
822
+ this.dragContainer.appendChild(this.dragSelectElement);
823
+ this.dragContainer.style.position = 'relative';
801
824
  }
825
+ EventHandler.add(this.dragContainer, 'scroll', this.onDragScroll, this);
802
826
  EventHandler.add(document, 'mouseup', this.onDragStop, this);
803
- EventHandler.add(this.viewElem, 'mousemove', this.onDrag, this);
827
+ EventHandler.add(this.dragContainer, 'mousemove', this.onDrag, this);
804
828
  EventHandler.add(this.dragSelectElement, 'mousemove', this.onDrag, this);
805
829
  }
806
830
  };
807
831
  FileManager.prototype.onDrag = function (event) {
832
+ this.lastDragEvent = event;
808
833
  event.stopPropagation();
809
- if (this.dragSelectElement) {
810
- var diffX = event.pageX - this.dragX;
811
- var diffY = event.pageY - this.dragY;
834
+ if (this.dragSelectElement && this.dragContainer) {
835
+ var ulRect = this.dragContainer.getBoundingClientRect();
836
+ var currentX = event.clientX - ulRect.left - this.dragContainer.clientLeft + this.dragContainer.scrollLeft;
837
+ var currentY = event.clientY - ulRect.top - this.dragContainer.clientTop + this.dragContainer.scrollTop;
812
838
  setStyleAttribute(this.dragSelectElement, {
813
- 'left': diffX < 0 ? this.dragX + diffX + 'px' : this.dragX + 'px', 'top': diffY < 0 ? this.dragY + diffY + 'px' : this.dragY + 'px',
814
- 'height': Math.abs(diffY) + 'px', 'width': Math.abs(diffX) + 'px'
839
+ left: Math.min(this.dragX, currentX) + 'px',
840
+ top: Math.min(this.dragY, currentY) + 'px',
841
+ height: Math.abs(currentY - this.dragY) + 'px',
842
+ width: Math.abs(currentX - this.dragX) + 'px'
815
843
  });
816
844
  this.selectItems();
817
845
  }
818
- else {
819
- EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
846
+ else if (this.dragContainer) {
847
+ EventHandler.remove(this.dragContainer, 'mousemove', this.onDrag);
820
848
  }
821
849
  };
850
+ FileManager.prototype.onDragScroll = function () {
851
+ if (!this.dragSelectElement || !this.lastDragEvent) {
852
+ return;
853
+ }
854
+ this.onDrag(this.lastDragEvent);
855
+ };
822
856
  FileManager.prototype.onDragStop = function () {
823
- if (this.viewElem) {
824
- EventHandler.remove(document, 'mouseup', this.onDragStop);
825
- EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
857
+ EventHandler.remove(document, 'mouseup', this.onDragStop);
858
+ if (this.dragContainer) {
859
+ EventHandler.remove(this.dragContainer, 'mousemove', this.onDrag);
860
+ EventHandler.remove(this.dragContainer, 'scroll', this.onDragScroll);
826
861
  }
827
862
  if (this.dragSelectElement) {
828
863
  EventHandler.remove(this.dragSelectElement, 'mousemove', this.onDrag);
@@ -833,6 +868,7 @@ var FileManager = /** @class */ (function (_super) {
833
868
  detach(this.dragSelectElement);
834
869
  this.dragSelectElement = null;
835
870
  }
871
+ this.dragContainer = null;
836
872
  };
837
873
  FileManager.prototype.selectItems = function () {
838
874
  var dragRect = this.dragSelectElement.getBoundingClientRect();
@@ -1123,6 +1159,7 @@ var FileManager = /** @class */ (function (_super) {
1123
1159
  removeClass([this.element], [CLS.RTL, CLS.MOBILE, CLS.CHECK_SELECT]);
1124
1160
  this.element.innerHTML = '';
1125
1161
  this.breadCrumbBarNavigation = null;
1162
+ this.breadCrumbNavElement = null;
1126
1163
  this.activeElements = null;
1127
1164
  this.virtualDragElement = null;
1128
1165
  this.visitedItem = null;
@@ -822,6 +822,7 @@ export interface IFileManager extends Component<HTMLElement> {
822
822
  extDialogObj: Dialog;
823
823
  splitterObj: Splitter;
824
824
  breadCrumbBarNavigation: HTMLElement;
825
+ breadCrumbNavElement: HTMLElement;
825
826
  searchSettings: SearchSettingsModel;
826
827
  activeElements: Element[];
827
828
  contextMenuSettings: ContextMenuSettingsModel;
@@ -520,9 +520,11 @@ var LargeIconsView = /** @class */ (function () {
520
520
  }
521
521
  }
522
522
  }
523
- var targetItem = this.getFocusedItem() || mappedItem || this.parent.visitedItem || this.getFirstItem();
524
- if (targetItem) {
525
- this.addFocus(targetItem);
523
+ if (this.parent.activeModule !== 'navigationpane') {
524
+ var targetItem = this.getFocusedItem() || mappedItem || this.parent.visitedItem || this.getFirstItem();
525
+ if (targetItem) {
526
+ this.addFocus(targetItem);
527
+ }
526
528
  }
527
529
  }
528
530
  };
@@ -760,13 +762,15 @@ var LargeIconsView = /** @class */ (function () {
760
762
  }
761
763
  };
762
764
  LargeIconsView.prototype.destroy = function () {
763
- if (this.parent.isDestroyed) {
764
- return;
765
- }
766
765
  this.removeEventListener();
767
766
  if (this.listObj) {
768
767
  this.unWireEvents();
769
768
  }
769
+ if (this.itemList) {
770
+ this.itemList.forEach(function (el) {
771
+ el.ondragstart = null;
772
+ });
773
+ }
770
774
  this.startItem = null;
771
775
  this.listElements = null;
772
776
  };
@@ -158,10 +158,16 @@ var ContextMenu = /** @class */ (function () {
158
158
  }
159
159
  else if (!isNOU(closest(target, 'tr.e-row'))) {
160
160
  uid = this.targetElement.getAttribute('data-uid');
161
- data = this.parent.detailsviewModule.gridObj.getRowObjectFromUID(uid).data;
162
- if (isNOU(this.targetElement.getAttribute('aria-selected'))) {
163
- /* istanbul ignore next */
164
- this.parent.detailsviewModule.gridObj.selectRows([parseInt(this.targetElement.getAttribute('aria-rowindex'), 10) - 1]);
161
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
162
+ var gridObj = this.parent.detailsviewModule && this.parent.detailsviewModule.gridObj;
163
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
164
+ var rowObj = (!isNOU(uid) && !isNOU(gridObj)) ? gridObj.getRowObjectFromUID(uid) : null;
165
+ if (!isNOU(rowObj)) {
166
+ data = rowObj.data;
167
+ if (isNOU(this.targetElement.getAttribute('aria-selected'))) {
168
+ /* istanbul ignore next */
169
+ gridObj.selectRows([parseInt(this.targetElement.getAttribute('aria-rowindex'), 10) - 1]);
170
+ }
165
171
  }
166
172
  selected = true;
167
173
  /* istanbul ignore next */
@@ -357,10 +363,12 @@ var ContextMenu = /** @class */ (function () {
357
363
  this.menuType = 'layout';
358
364
  this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.layout.map(function (item) { return item.trim(); }));
359
365
  this.contextMenu.dataBind();
360
- if (!this.parent.allowMultiSelection || ((this.parent.view === 'LargeIcons' &&
361
- (closest(target, '#' + this.parent.element.id + CLS.LARGEICON_ID).getElementsByClassName(CLS.EMPTY).length !== 0))
362
- || (this.parent.view === 'Details' &&
363
- (closest(target, '#' + this.parent.element.id + CLS.GRID_ID).getElementsByClassName(CLS.EMPTY).length !== 0)))) {
366
+ var largeIconsEle = closest(target, '#' + this.parent.element.id + CLS.LARGEICON_ID);
367
+ var detailsViewEle = closest(target, '#' + this.parent.element.id + CLS.GRID_ID);
368
+ if (!this.parent.allowMultiSelection || ((this.parent.view === 'LargeIcons' && !isNOU(largeIconsEle) &&
369
+ (largeIconsEle.getElementsByClassName(CLS.EMPTY).length !== 0))
370
+ || (this.parent.view === 'Details' && !isNOU(detailsViewEle) &&
371
+ (detailsViewEle.getElementsByClassName(CLS.EMPTY).length !== 0)))) {
364
372
  this.disabledItems.push('SelectAll');
365
373
  }
366
374
  else {