@stemy/ngx-utils 19.9.35 → 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.
- package/fesm2022/stemy-ngx-utils.mjs +10 -12
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +2 -2
- package/ngx-utils/components/upload/upload.component.d.ts +1 -1
- package/ngx-utils/ngx-utils.imports.d.ts +1 -1
- package/ngx-utils/ngx-utils.module.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -9975,6 +9976,10 @@ function loadBaseHref(baseUrl) {
|
|
|
9975
9976
|
function getRootElement() {
|
|
9976
9977
|
return typeof document !== "undefined" ? document.body : null;
|
|
9977
9978
|
}
|
|
9979
|
+
function defaultAppInitializer() {
|
|
9980
|
+
const configs = inject(CONFIG_SERVICE);
|
|
9981
|
+
return configs.load();
|
|
9982
|
+
}
|
|
9978
9983
|
class NgxUtilsModule {
|
|
9979
9984
|
static getProviders(config) {
|
|
9980
9985
|
return [
|
|
@@ -10059,14 +10064,7 @@ class NgxUtilsModule {
|
|
|
10059
10064
|
useFactory: loadBaseHref,
|
|
10060
10065
|
deps: [APP_BASE_URL]
|
|
10061
10066
|
},
|
|
10062
|
-
provideAppInitializer(
|
|
10063
|
-
if (config && config.initializeApp) {
|
|
10064
|
-
const initializer = config.initializeApp(inject(Injector));
|
|
10065
|
-
return initializer();
|
|
10066
|
-
}
|
|
10067
|
-
const configs = inject(CONFIG_SERVICE);
|
|
10068
|
-
return configs.load();
|
|
10069
|
-
}),
|
|
10067
|
+
provideAppInitializer(config?.initializeApp || defaultAppInitializer),
|
|
10070
10068
|
];
|
|
10071
10069
|
}
|
|
10072
10070
|
static forRoot(config) {
|