@syncfusion/ej2-filemanager 33.1.47 → 33.2.4

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.1.47
3
+ * version : 33.2.4
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.1.47",
3
+ "version": "33.2.4",
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": "~33.1.45",
12
- "@syncfusion/ej2-buttons": "~33.1.44",
13
- "@syncfusion/ej2-data": "~33.1.45",
14
- "@syncfusion/ej2-grids": "~33.1.47",
15
- "@syncfusion/ej2-inputs": "~33.1.47",
16
- "@syncfusion/ej2-layouts": "~33.1.47",
17
- "@syncfusion/ej2-lists": "~33.1.47",
18
- "@syncfusion/ej2-navigations": "~33.1.47",
19
- "@syncfusion/ej2-popups": "~33.1.44",
20
- "@syncfusion/ej2-splitbuttons": "~33.1.44"
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.4",
15
+ "@syncfusion/ej2-inputs": "~33.2.4",
16
+ "@syncfusion/ej2-layouts": "~33.2.3",
17
+ "@syncfusion/ej2-lists": "~33.2.3",
18
+ "@syncfusion/ej2-navigations": "~33.2.4",
19
+ "@syncfusion/ej2-popups": "~33.2.3",
20
+ "@syncfusion/ej2-splitbuttons": "~33.2.3"
21
21
  },
22
22
  "devDependencies": {},
23
23
  "keywords": [
@@ -158,6 +158,8 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
158
158
  private dragX;
159
159
  private dragY;
160
160
  private dragSelectedItems;
161
+ private lastDragEvent;
162
+ private dragContainer;
161
163
  /**
162
164
  * Specifies the AJAX settings of the file manager.
163
165
  *
@@ -709,6 +711,7 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
709
711
  private onScrollHandler;
710
712
  private onDragStart;
711
713
  private onDrag;
714
+ private onDragScroll;
712
715
  private onDragStop;
713
716
  private selectItems;
714
717
  private onLayoutChange;
@@ -788,41 +788,74 @@ var FileManager = /** @class */ (function (_super) {
788
788
  return;
789
789
  }
790
790
  }
791
+ var contentElem = this.viewElem.firstChild;
792
+ var isLargeIcons = this.viewElem.classList.contains('e-large-icons');
793
+ if (isLargeIcons) {
794
+ this.dragContainer = (contentElem && contentElem.tagName === 'UL') ? contentElem : this.viewElem;
795
+ }
796
+ else {
797
+ this.dragContainer = this.viewElem.firstChild;
798
+ }
799
+ if (!this.dragContainer) {
800
+ return;
801
+ }
791
802
  event.preventDefault();
792
- this.dragX = event.pageX;
793
- this.dragY = event.pageY;
803
+ this.lastDragEvent = event;
804
+ var ulRect = this.dragContainer.getBoundingClientRect();
805
+ this.dragX = event.clientX - ulRect.left - this.dragContainer.clientLeft + this.dragContainer.scrollLeft;
806
+ this.dragY = event.clientY - ulRect.top - this.dragContainer.clientTop + this.dragContainer.scrollTop;
794
807
  if (!this.dragSelectElement) {
795
808
  this.dragSelectElement = createElement('div', {
796
809
  id: this.element.id + '_drag',
797
- className: 'e-filemanager e-drag-select',
798
- styles: 'left: ' + this.dragX + 'px;top: ' + this.dragY + 'px;'
810
+ className: 'e-filemanager e-drag-select'
811
+ });
812
+ setStyleAttribute(this.dragSelectElement, {
813
+ position: 'absolute',
814
+ left: this.dragX + 'px',
815
+ top: this.dragY + 'px',
816
+ width: '0px',
817
+ height: '0px',
818
+ pointerEvents: 'none'
799
819
  });
800
- document.body.append(this.dragSelectElement);
820
+ this.dragContainer.appendChild(this.dragSelectElement);
821
+ this.dragContainer.style.position = 'relative';
801
822
  }
823
+ EventHandler.add(this.dragContainer, 'scroll', this.onDragScroll, this);
802
824
  EventHandler.add(document, 'mouseup', this.onDragStop, this);
803
- EventHandler.add(this.viewElem, 'mousemove', this.onDrag, this);
825
+ EventHandler.add(this.dragContainer, 'mousemove', this.onDrag, this);
804
826
  EventHandler.add(this.dragSelectElement, 'mousemove', this.onDrag, this);
805
827
  }
806
828
  };
807
829
  FileManager.prototype.onDrag = function (event) {
830
+ this.lastDragEvent = event;
808
831
  event.stopPropagation();
809
- if (this.dragSelectElement) {
810
- var diffX = event.pageX - this.dragX;
811
- var diffY = event.pageY - this.dragY;
832
+ if (this.dragSelectElement && this.dragContainer) {
833
+ var ulRect = this.dragContainer.getBoundingClientRect();
834
+ var currentX = event.clientX - ulRect.left - this.dragContainer.clientLeft + this.dragContainer.scrollLeft;
835
+ var currentY = event.clientY - ulRect.top - this.dragContainer.clientTop + this.dragContainer.scrollTop;
812
836
  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'
837
+ left: Math.min(this.dragX, currentX) + 'px',
838
+ top: Math.min(this.dragY, currentY) + 'px',
839
+ height: Math.abs(currentY - this.dragY) + 'px',
840
+ width: Math.abs(currentX - this.dragX) + 'px'
815
841
  });
816
842
  this.selectItems();
817
843
  }
818
- else {
819
- EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
844
+ else if (this.dragContainer) {
845
+ EventHandler.remove(this.dragContainer, 'mousemove', this.onDrag);
820
846
  }
821
847
  };
848
+ FileManager.prototype.onDragScroll = function () {
849
+ if (!this.dragSelectElement || !this.lastDragEvent) {
850
+ return;
851
+ }
852
+ this.onDrag(this.lastDragEvent);
853
+ };
822
854
  FileManager.prototype.onDragStop = function () {
823
- if (this.viewElem) {
824
- EventHandler.remove(document, 'mouseup', this.onDragStop);
825
- EventHandler.remove(this.viewElem, 'mousemove', this.onDrag);
855
+ EventHandler.remove(document, 'mouseup', this.onDragStop);
856
+ if (this.dragContainer) {
857
+ EventHandler.remove(this.dragContainer, 'mousemove', this.onDrag);
858
+ EventHandler.remove(this.dragContainer, 'scroll', this.onDragScroll);
826
859
  }
827
860
  if (this.dragSelectElement) {
828
861
  EventHandler.remove(this.dragSelectElement, 'mousemove', this.onDrag);
@@ -833,6 +866,7 @@ var FileManager = /** @class */ (function (_super) {
833
866
  detach(this.dragSelectElement);
834
867
  this.dragSelectElement = null;
835
868
  }
869
+ this.dragContainer = null;
836
870
  };
837
871
  FileManager.prototype.selectItems = function () {
838
872
  var dragRect = this.dragSelectElement.getBoundingClientRect();
@@ -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
  };
@@ -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 {