@stemy/ngx-utils 19.9.36 → 19.9.37
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.
|
@@ -9495,7 +9495,7 @@ class UploadComponent {
|
|
|
9495
9495
|
let length = transfer.items?.length ?? 0;
|
|
9496
9496
|
for (let i = 0; i < length; i++) {
|
|
9497
9497
|
const item = transfer.items[i];
|
|
9498
|
-
if (this.checkType(item
|
|
9498
|
+
if (this.checkType(item)) {
|
|
9499
9499
|
ev.dataTransfer.effectAllowed = "copy";
|
|
9500
9500
|
ev.dataTransfer.dropEffect = "copy";
|
|
9501
9501
|
this.dropAllowed = true;
|
|
@@ -9505,7 +9505,7 @@ class UploadComponent {
|
|
|
9505
9505
|
length = transfer.files?.length ?? 0;
|
|
9506
9506
|
for (let i = 0; i < length; i++) {
|
|
9507
9507
|
const file = transfer.files[i];
|
|
9508
|
-
if (this.checkType(file
|
|
9508
|
+
if (this.checkType(file)) {
|
|
9509
9509
|
ev.dataTransfer.effectAllowed = "copy";
|
|
9510
9510
|
ev.dataTransfer.dropEffect = "copy";
|
|
9511
9511
|
this.dropAllowed = true;
|
|
@@ -9573,7 +9573,7 @@ class UploadComponent {
|
|
|
9573
9573
|
const files = [];
|
|
9574
9574
|
for (let i = 0; i < length; i++) {
|
|
9575
9575
|
const file = input.files.item(i);
|
|
9576
|
-
if (this.checkType(file
|
|
9576
|
+
if (this.checkType(file)) {
|
|
9577
9577
|
files.push(file);
|
|
9578
9578
|
}
|
|
9579
9579
|
}
|
|
@@ -9665,9 +9665,10 @@ class UploadComponent {
|
|
|
9665
9665
|
this.cdr.detectChanges();
|
|
9666
9666
|
return results.filter(r => r !== null);
|
|
9667
9667
|
}
|
|
9668
|
-
checkType(
|
|
9668
|
+
checkType(file) {
|
|
9669
9669
|
if (this.acceptTypes.length == 0)
|
|
9670
9670
|
return true;
|
|
9671
|
+
let type = file.type || String(file.name || "").split(".").pop();
|
|
9671
9672
|
type = type.split("/").pop().replace(/\./g, "");
|
|
9672
9673
|
return this.acceptTypes.includes(type);
|
|
9673
9674
|
}
|