@acorex/core 17.0.21 → 17.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/date-time/lib/calendar.service.mjs +6 -13
- package/esm2022/file/lib/file-size-formatter.mjs +1 -1
- package/esm2022/file/lib/file.service.mjs +57 -22
- package/esm2022/format/lib/format.service.mjs +1 -3
- package/fesm2022/acorex-core-date-time.mjs +4 -11
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-file.mjs +56 -20
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +0 -2
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/file/lib/file.service.d.ts +5 -3
- package/package.json +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
+
import { AXEventService, AXEventTypes } from '@acorex/core/events';
|
1
2
|
import { Injectable, inject } from '@angular/core';
|
2
3
|
import { BehaviorSubject, Subject } from 'rxjs';
|
3
4
|
import { AX_DATETIME_CONFIG } from './dateTime.config';
|
4
5
|
import { AXDateTime } from './datetime.class';
|
5
|
-
import { AX_DATETIME_HOLIDAYS_LOADER
|
6
|
-
import { AXEventService, AXEventTypes } from '@acorex/core/events';
|
6
|
+
import { AX_DATETIME_HOLIDAYS_LOADER } from './holidays.loader';
|
7
7
|
import * as i0 from "@angular/core";
|
8
8
|
export class AXCalendarService {
|
9
9
|
get calendar() {
|
@@ -45,9 +45,7 @@ export class AXCalendarService {
|
|
45
45
|
});
|
46
46
|
}
|
47
47
|
create(value, calendarName) {
|
48
|
-
const calendar = calendarName
|
49
|
-
? this.resolveCalendar(calendarName)
|
50
|
-
: this.calendar;
|
48
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
51
49
|
if (value instanceof Date) {
|
52
50
|
return new AXDateTime(value, calendar);
|
53
51
|
}
|
@@ -57,15 +55,12 @@ export class AXCalendarService {
|
|
57
55
|
return this.now();
|
58
56
|
}
|
59
57
|
now(calendarName) {
|
60
|
-
const calendar = calendarName
|
61
|
-
? this.resolveCalendar(calendarName)
|
62
|
-
: this.calendar;
|
58
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
63
59
|
return new AXDateTime(new Date(), calendar);
|
64
60
|
}
|
65
61
|
resolveCalendar(name) {
|
66
62
|
const c = this.config.calendars[name];
|
67
63
|
if (!c) {
|
68
|
-
console.error(`"${name}" is not a valid calendar name!`);
|
69
64
|
return this.calendar;
|
70
65
|
}
|
71
66
|
return c;
|
@@ -78,9 +73,7 @@ export class AXCalendarService {
|
|
78
73
|
return d instanceof Date && !isNaN(d.getTime()); // valid date
|
79
74
|
};
|
80
75
|
//
|
81
|
-
const calendar = calendarName
|
82
|
-
? this.resolveCalendar(calendarName)
|
83
|
-
: this.calendar;
|
76
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
84
77
|
if (typeof value === 'string') {
|
85
78
|
if (isISOString(value))
|
86
79
|
return new AXDateTime(new Date(value), calendar);
|
@@ -97,4 +90,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
97
90
|
type: Injectable,
|
98
91
|
args: [{ providedIn: 'root' }]
|
99
92
|
}], ctorParameters: () => [] });
|
100
|
-
//# sourceMappingURL=data:application/json;base64,
|
93
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9kYXRlLXRpbWUvc3JjL2xpYi9jYWxlbmRhci5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsWUFBWSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbkUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7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GlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnKSB7XG4gICAgICBpZiAoaXNJU09TdHJpbmcodmFsdWUpKSByZXR1cm4gbmV3IEFYRGF0ZVRpbWUobmV3IERhdGUodmFsdWUpLCBjYWxlbmRhcik7XG4gICAgICBlbHNlIHJldHVybiBjYWxlbmRhci5wYXJzZSh2YWx1ZSk7XG4gICAgfVxuICAgIGNvbnN0IGRhdGUgPSB2YWx1ZSBpbnN0YW5jZW9mIEFYRGF0ZVRpbWUgPyB2YWx1ZS5kYXRlIDogKHZhbHVlIGFzIERhdGUpO1xuICAgIHJldHVybiBuZXcgQVhEYXRlVGltZShkYXRlLCBjYWxlbmRhcik7XG4gIH1cbn1cbiJdfQ==
|
@@ -21,4 +21,4 @@ export class AXFileSizeFormatter {
|
|
21
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXFileSizeFormatter, decorators: [{
|
22
22
|
type: Injectable
|
23
23
|
}] });
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS1zaXplLWZvcm1hdHRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9maWxlL3NyYy9saWIvZmlsZS1zaXplLWZvcm1hdHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQWEzQyxNQUFNLE9BQU8sbUJBQW1CO0lBQzlCLElBQUksSUFBSTtRQUNOLE9BQU8sVUFBVSxDQUFDO0lBQ3BCLENBQUM7SUFFRCxNQUFNLENBQUMsS0FBYTtRQUNsQixNQUFNLElBQUksR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFFM0IsSUFBS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1xuICBmb3JtYXQ6IHN0cmluZztcbn1cblxuZGVjbGFyZSBtb2R1bGUgJ0BhY29yZXgvY29yZS9mb3JtYXQnIHtcbiAgaW50ZXJmYWNlIEFYRm9ybWF0T3B0aW9uc01hcCB7XG4gICAgZmlsZXNpemU6IEFYRmlsZVNpemVGb3JtYXR0ZXJPcHRpb25zO1xuICB9XG59XG5cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBBWEZpbGVTaXplRm9ybWF0dGVyIGltcGxlbWVudHMgQVhGb3JtYXR0ZXIge1xuICBnZXQgbmFtZSgpOiBzdHJpbmcge1xuICAgIHJldHVybiAnZmlsZXNpemUnO1xuICB9XG5cbiAgZm9ybWF0KHZhbHVlOiBudW1iZXIpOiBzdHJpbmcge1xuICAgIGNvbnN0IHNpemUgPSBOdW1iZXIodmFsdWUpO1xuXG4gICAgaWYgKHNpemUgPT09IDApIHJldHVybiAnMCBCeXRlcyc7XG4gICAgaWYgKE51bWJlci5pc05hTihzaXplKSkgcmV0dXJuICdVbmtub3duJztcblxuICAgIGNvbnN0IGsgPSAxMDI0O1xuICAgIGNvbnN0IHNpemVzID0gWydCeXRlcycsICdLQicsICdNQicsICdHQicsICdUQicsICdQQicsICdFQicsICdaQicsICdZQiddO1xuICAgIGNvbnN0IGkgPSBNYXRoLmZsb29yKE1hdGgubG9nKHNpemUpIC8gTWF0aC5sb2coaykpO1xuXG4gICAgcmV0dXJuIHBhcnNlRmxvYXQoKHNpemUgLyBNYXRoLnBvdyhrLCBpKSkudG9GaXhlZCgyKSkgKyAnICcgKyBzaXplc1tpXTtcbiAgfVxufVxuIl19
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
1
|
+
import { HttpClient, HttpRequest } from '@angular/common/http';
|
2
2
|
import { Injectable } from '@angular/core';
|
3
|
-
import { isObservable } from 'rxjs';
|
4
3
|
import { AXFileDownloadRef } from './file-download-ref.class';
|
5
4
|
import { AXFileDownloadResult } from './file-download-result.class';
|
6
5
|
import { AXFileUploadRef } from './file-upload-ref.class';
|
@@ -9,37 +8,60 @@ import * as i1 from "@angular/common/http";
|
|
9
8
|
export class AXFileService {
|
10
9
|
constructor(_httpClient) {
|
11
10
|
this._httpClient = _httpClient;
|
12
|
-
this.blobToBase64 = (blob) =>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
this.blobToBase64 = (blob) => {
|
12
|
+
return new Promise((resolve, reject) => {
|
13
|
+
const reader = new FileReader();
|
14
|
+
reader.onerror = reject;
|
15
|
+
reader.onload = () => {
|
16
|
+
resolve(reader.result);
|
17
|
+
};
|
18
|
+
reader.readAsDataURL(blob);
|
19
|
+
});
|
20
|
+
};
|
20
21
|
}
|
21
22
|
download(request) {
|
23
|
+
console.log(typeof request);
|
22
24
|
let s;
|
23
25
|
const promiseFunc = (resolve, reject) => {
|
24
|
-
|
25
|
-
|
26
|
-
let b;
|
27
|
-
if (typeof request === 'string') {
|
28
|
-
b = this._httpClient.get(request, { responseType: 'blob' });
|
26
|
+
if (typeof request == 'string') {
|
27
|
+
//
|
29
28
|
}
|
30
|
-
|
31
|
-
|
29
|
+
if (request instanceof Blob) {
|
30
|
+
//
|
31
|
+
}
|
32
|
+
if (request instanceof HttpRequest) {
|
33
|
+
const b = this._httpClient.request(request);
|
34
|
+
b.subscribe({
|
35
|
+
next: (v) => resolve(new AXFileDownloadResult(v)),
|
36
|
+
error: (e) => reject(e),
|
37
|
+
});
|
32
38
|
}
|
33
|
-
s = b?.subscribe({
|
34
|
-
next: (v) => resolve(new AXFileDownloadResult(v)),
|
35
|
-
error: (e) => reject(e),
|
36
|
-
});
|
37
39
|
};
|
38
40
|
const a = new AXFileDownloadRef(promiseFunc);
|
39
41
|
a.abort = () => {
|
40
42
|
s?.unsubscribe();
|
41
43
|
};
|
42
44
|
return a;
|
45
|
+
// let s: Subscription;
|
46
|
+
// const promiseFunc = (resolve, reject) => {
|
47
|
+
// //TODO: add custome http request
|
48
|
+
// //const headers = new HttpHeaders().set('authorization','Bearer '+token);
|
49
|
+
// let b!: Observable<Blob>;
|
50
|
+
// if (typeof request === 'string') {
|
51
|
+
// b = this._httpClient.get(request, { responseType: 'blob' });
|
52
|
+
// } else if (isObservable(b)) {
|
53
|
+
// b = request;
|
54
|
+
// }
|
55
|
+
// s = b?.subscribe({
|
56
|
+
// next: (v) => resolve(new AXFileDownloadResult(v)),
|
57
|
+
// error: (e) => reject(e),
|
58
|
+
// });
|
59
|
+
// };
|
60
|
+
// const a = new AXFileDownloadRef(promiseFunc);
|
61
|
+
// a.abort = () => {
|
62
|
+
// s?.unsubscribe();
|
63
|
+
// };
|
64
|
+
// return a;
|
43
65
|
}
|
44
66
|
upload(url, files) {
|
45
67
|
let s;
|
@@ -91,6 +113,19 @@ export class AXFileService {
|
|
91
113
|
input.click();
|
92
114
|
});
|
93
115
|
}
|
116
|
+
getSize(file) {
|
117
|
+
if (this.isBase64(file)) {
|
118
|
+
return this.getBase64Size(file);
|
119
|
+
}
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
isBase64(base64) {
|
123
|
+
const regx = /[^:]\w+\/[\w-+\d.]+(?=;|,)/;
|
124
|
+
return regx.test(base64);
|
125
|
+
}
|
126
|
+
getBase64Size(base64) {
|
127
|
+
return atob(base64.substring(base64.indexOf(',') + 1)).length;
|
128
|
+
}
|
94
129
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXFileService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
95
130
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXFileService, providedIn: 'root' }); }
|
96
131
|
}
|
@@ -100,4 +135,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
100
135
|
providedIn: 'root',
|
101
136
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KSkge1xuICAgICAgcmV0dXJuIHRoaXMuZ2V0QmFzZTY0U2l6ZShmaWxlIGFzIHN0cmluZyk7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHB1YmxpYyBpc0Jhc2U2NChiYXNlNjQ6IHN0cmluZykge1xuICAgIGNvbnN0IHJlZ3ggPSAvW146XVxcdytcXC9bXFx3LStcXGQuXSsoPz07fCwpLztcbiAgICByZXR1cm4gcmVneC50ZXN0KGJhc2U2NCk7XG4gIH1cblxuICBwdWJsaWMgZ2V0QmFzZTY0U2l6ZShiYXNlNjQ6IHN0cmluZykge1xuICAgIHJldHVybiBhdG9iKGJhc2U2NC5zdWJzdHJpbmcoYmFzZTY0LmluZGV4T2YoJywnKSArIDEpKS5sZW5ndGg7XG4gIH1cbn1cbiJdfQ==
|
@@ -86,10 +86,8 @@ class AXFormatFluent {
|
|
86
86
|
return formatterRef.format(this.initialValue, options);
|
87
87
|
}
|
88
88
|
catch (error) {
|
89
|
-
// Handle or log the error as needed
|
90
|
-
console.error(error);
|
91
89
|
return String(this.initialValue);
|
92
90
|
}
|
93
91
|
}
|
94
92
|
}
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
93
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvZm9ybWF0L3NyYy9saWIvZm9ybWF0LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDckQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQzs7QUFPL0IsTUFBTSxPQUFPLDBCQUEwQjtJQUtyQyxZQUFZLFFBQWtCO1FBS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AgICovXG4gIHRvPEsgZXh0ZW5kcyBrZXlvZiBBWEZvcm1hdE9wdGlvbnNNYXA+KGZvcm1hdHRlcjogSywgb3B0aW9ucz86IEFYRm9ybWF0T3B0aW9uc01hcFtLXSk6IHN0cmluZyB7XG4gICAgdHJ5IHtcbiAgICAgIGNvbnN0IGZvcm1hdHRlclJlZiA9IHRoaXMuZm9ybWF0U2VydmljZS5yZXNvbHZlRm9ybWF0dGVyKGZvcm1hdHRlcik7XG4gICAgICByZXR1cm4gZm9ybWF0dGVyUmVmLmZvcm1hdCh0aGlzLmluaXRpYWxWYWx1ZSwgb3B0aW9ucyk7XG4gICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgIHJldHVybiBTdHJpbmcodGhpcy5pbml0aWFsVmFsdWUpO1xuICAgIH1cbiAgfVxufVxuIl19
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, inject, Injectable, Pipe, NgModule } from '@angular/core';
|
3
|
+
import { AXEventTypes, AXEventService } from '@acorex/core/events';
|
3
4
|
import { BehaviorSubject, Subject } from 'rxjs';
|
4
5
|
import { AX_GLOBAL_CONFIG } from '@acorex/core/config';
|
5
6
|
import { defaults, orderBy, set, isNil } from 'lodash-es';
|
6
7
|
import { isBrowser } from '@acorex/core/platform';
|
7
8
|
import { translateSync } from '@acorex/core/translation';
|
8
|
-
import { AXEventTypes, AXEventService } from '@acorex/core/events';
|
9
9
|
import * as i1 from '@acorex/core/format';
|
10
10
|
import { AXFormatModule } from '@acorex/core/format';
|
11
11
|
|
@@ -1081,9 +1081,7 @@ class AXCalendarService {
|
|
1081
1081
|
});
|
1082
1082
|
}
|
1083
1083
|
create(value, calendarName) {
|
1084
|
-
const calendar = calendarName
|
1085
|
-
? this.resolveCalendar(calendarName)
|
1086
|
-
: this.calendar;
|
1084
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
1087
1085
|
if (value instanceof Date) {
|
1088
1086
|
return new AXDateTime(value, calendar);
|
1089
1087
|
}
|
@@ -1093,15 +1091,12 @@ class AXCalendarService {
|
|
1093
1091
|
return this.now();
|
1094
1092
|
}
|
1095
1093
|
now(calendarName) {
|
1096
|
-
const calendar = calendarName
|
1097
|
-
? this.resolveCalendar(calendarName)
|
1098
|
-
: this.calendar;
|
1094
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
1099
1095
|
return new AXDateTime(new Date(), calendar);
|
1100
1096
|
}
|
1101
1097
|
resolveCalendar(name) {
|
1102
1098
|
const c = this.config.calendars[name];
|
1103
1099
|
if (!c) {
|
1104
|
-
console.error(`"${name}" is not a valid calendar name!`);
|
1105
1100
|
return this.calendar;
|
1106
1101
|
}
|
1107
1102
|
return c;
|
@@ -1114,9 +1109,7 @@ class AXCalendarService {
|
|
1114
1109
|
return d instanceof Date && !isNaN(d.getTime()); // valid date
|
1115
1110
|
};
|
1116
1111
|
//
|
1117
|
-
const calendar = calendarName
|
1118
|
-
? this.resolveCalendar(calendarName)
|
1119
|
-
: this.calendar;
|
1112
|
+
const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;
|
1120
1113
|
if (typeof value === 'string') {
|
1121
1114
|
if (isISOString(value))
|
1122
1115
|
return new AXDateTime(new Date(value), calendar);
|