@acorex/core 7.5.0 → 7.5.1

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.
Files changed (65) hide show
  1. package/dateTime/lib/georgian.calendar.d.ts +2 -2
  2. package/esm2022/config/lib/configs.mjs +2 -2
  3. package/esm2022/config/lib/configs.service.mjs +2 -2
  4. package/esm2022/dateTime/lib/calendar.service.mjs +6 -7
  5. package/esm2022/dateTime/lib/dateTime.config.mjs +34 -26
  6. package/esm2022/dateTime/lib/datetime.class.mjs +1 -1
  7. package/esm2022/dateTime/lib/datetime.module.mjs +2 -2
  8. package/esm2022/dateTime/lib/datetime.pipe.mjs +1 -1
  9. package/esm2022/dateTime/lib/georgian.calendar.mjs +40 -44
  10. package/esm2022/dateTime/lib/jalali.calendar.mjs +21 -25
  11. package/esm2022/events/lib/event.service.mjs +4 -4
  12. package/esm2022/file/lib/file-download-ref.class.mjs +1 -1
  13. package/esm2022/file/lib/file-download-result.class.mjs +3 -3
  14. package/esm2022/file/lib/file-upload-ref.class.mjs +1 -1
  15. package/esm2022/file/lib/file.service.mjs +8 -10
  16. package/esm2022/image/lib/image.service.mjs +9 -9
  17. package/esm2022/intl/lib/numbers/number-format-options.mjs +3 -3
  18. package/esm2022/intl/lib/numbers/numbers-utils.mjs +5 -5
  19. package/esm2022/pipes/lib/pipes.module.mjs +2 -2
  20. package/esm2022/pipes/lib/safe.pipe.mjs +15 -9
  21. package/esm2022/translation/lib/translation.module.mjs +1 -1
  22. package/esm2022/translation/lib/translator.pipe.mjs +1 -1
  23. package/esm2022/utils/lib/color-util.mjs +2 -2
  24. package/esm2022/utils/lib/drawing-util.mjs +6 -3
  25. package/esm2022/utils/lib/string-util.mjs +2 -2
  26. package/fesm2022/acorex-core-config.mjs +1 -1
  27. package/fesm2022/acorex-core-config.mjs.map +1 -1
  28. package/fesm2022/acorex-core-dateTime.mjs +240 -241
  29. package/fesm2022/acorex-core-dateTime.mjs.map +1 -1
  30. package/fesm2022/acorex-core-events.mjs +3 -3
  31. package/fesm2022/acorex-core-events.mjs.map +1 -1
  32. package/fesm2022/acorex-core-file.mjs +9 -11
  33. package/fesm2022/acorex-core-file.mjs.map +1 -1
  34. package/fesm2022/acorex-core-image.mjs +8 -8
  35. package/fesm2022/acorex-core-image.mjs.map +1 -1
  36. package/fesm2022/acorex-core-intl.mjs +5 -5
  37. package/fesm2022/acorex-core-intl.mjs.map +1 -1
  38. package/fesm2022/acorex-core-pipes.mjs +14 -8
  39. package/fesm2022/acorex-core-pipes.mjs.map +1 -1
  40. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  41. package/fesm2022/acorex-core-utils.mjs +7 -4
  42. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  43. package/file/lib/file-download-ref.class.d.ts +1 -1
  44. package/image/lib/image.service.d.ts +0 -1
  45. package/intl/lib/numbers/numbers-utils.d.ts +1 -1
  46. package/package.json +1 -7
  47. package/pipes/lib/safe.pipe.d.ts +1 -1
  48. package/esm2022/http/acorex-core-http.mjs +0 -5
  49. package/esm2022/http/index.mjs +0 -7
  50. package/esm2022/http/lib/http-error.class.mjs +0 -2
  51. package/esm2022/http/lib/http-events.interceptor.mjs +0 -3
  52. package/esm2022/http/lib/http-request.class.mjs +0 -2
  53. package/esm2022/http/lib/http-result.class.mjs +0 -21
  54. package/esm2022/http/lib/http.module.mjs +0 -29
  55. package/esm2022/http/lib/http.service.mjs +0 -148
  56. package/fesm2022/acorex-core-http.mjs +0 -201
  57. package/fesm2022/acorex-core-http.mjs.map +0 -1
  58. package/http/README.md +0 -3
  59. package/http/index.d.ts +0 -6
  60. package/http/lib/http-error.class.d.ts +0 -7
  61. package/http/lib/http-events.interceptor.d.ts +0 -10
  62. package/http/lib/http-request.class.d.ts +0 -14
  63. package/http/lib/http-result.class.d.ts +0 -11
  64. package/http/lib/http.module.d.ts +0 -8
  65. package/http/lib/http.service.d.ts +0 -23
@@ -1,201 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, NgModule } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import * as i1 from '@angular/common/http';
5
- import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
6
-
7
- const AX_HTTP_EVENT_INTERCEPTOR = new InjectionToken('ax.http.events');
8
-
9
- class HttpResult {
10
- constructor(executor) {
11
- this._executor = executor;
12
- setTimeout(() => {
13
- this._executor(this.resultAction, this.errorAction, this.completeAction);
14
- }, 50);
15
- }
16
- result(action) {
17
- this.resultAction = action;
18
- return this;
19
- }
20
- error(action) {
21
- this.errorAction = action;
22
- return this;
23
- }
24
- complete(action) {
25
- this.completeAction = action;
26
- return this;
27
- }
28
- }
29
-
30
- // import { catchError, retry, retryWhen, mergeMap, delay, switchMap, scan, takeWhile, flatMap } from 'rxjs/operators';
31
- // import { of, concat, throwError } from 'rxjs';
32
- class AXHttpService {
33
- constructor(http, injector) {
34
- this.http = http;
35
- this.injector = injector;
36
- this.interceptor = this.injector.get(AX_HTTP_EVENT_INTERCEPTOR);
37
- }
38
- get(url, config = {}) {
39
- config.url = url;
40
- config.method = "get";
41
- return this.request(config);
42
- }
43
- post(url, config = {}) {
44
- config.url = url;
45
- config.method = "post";
46
- return this.request(config);
47
- }
48
- delete(url, config = {}) {
49
- config.url = url;
50
- config.method = "delete";
51
- return this.request(config);
52
- }
53
- put(url, config = {}) {
54
- config.url = url;
55
- config.method = "put";
56
- return this.request(config);
57
- }
58
- request(config) {
59
- return new HttpResult((result, error, complete) => {
60
- this.handleBegin(config).then(c => {
61
- this.http
62
- //TODO: check ts error
63
- //@ts-ignore
64
- .request(config.method, config.url, this.mapOptions(config))
65
- //.pipe(this.retry)
66
- .subscribe(data => {
67
- this.handleResult(data, result, complete, config);
68
- }, c => {
69
- this.handleError(c, error, complete, config);
70
- });
71
- });
72
- });
73
- }
74
- handleResult(data, result, complete, config) {
75
- if (this.interceptor) {
76
- this.interceptor.success(config, data).then(c => {
77
- if (result)
78
- result(c);
79
- this.handleComplete(complete, config);
80
- });
81
- }
82
- else {
83
- //
84
- if (result)
85
- result(data);
86
- this.handleComplete(complete, config);
87
- }
88
- }
89
- handleBegin(config) {
90
- return new Promise((resolve) => {
91
- if (!config.headers)
92
- config.headers = {};
93
- if (!config.params)
94
- config.params = {};
95
- //
96
- if (this.interceptor) {
97
- this.interceptor.begin(config).then(c => {
98
- resolve(c);
99
- });
100
- }
101
- else {
102
- resolve(config);
103
- }
104
- });
105
- }
106
- handleComplete(complete, config) {
107
- if (complete)
108
- complete();
109
- if (this.interceptor)
110
- this.interceptor.complete(config);
111
- }
112
- handleError(c, error, complete, config) {
113
- let r = {
114
- message: c.message,
115
- status: c.status,
116
- code: c.status?.toString(),
117
- handled: false,
118
- error: c.error
119
- };
120
- if (error) {
121
- error(r);
122
- }
123
- if (!r.handled) {
124
- if (this.interceptor)
125
- this.interceptor.error(config, r);
126
- }
127
- this.handleComplete(complete, config);
128
- }
129
- mapOptions(options) {
130
- let headers = new HttpHeaders();
131
- for (const key in options.headers) {
132
- if (options.headers.hasOwnProperty(key)) {
133
- const value = options.headers[key];
134
- headers = headers.set(key, value);
135
- }
136
- }
137
- let params = new HttpParams();
138
- for (const key in options.params) {
139
- if (options.params.hasOwnProperty(key)) {
140
- const value = options.params[key];
141
- params = params.set(key, value);
142
- }
143
- }
144
- return {
145
- headers: headers,
146
- params: params,
147
- body: options.body,
148
- responseType: options.responseType || 'json'
149
- };
150
- // if (options.method == "get") {
151
- // return {
152
- // headers: headers,
153
- // params: params
154
- // };
155
- // }
156
- // else {
157
- // return {
158
- // headers: headers,
159
- // params: params,
160
- // body: options.body
161
- // };
162
- // }
163
- }
164
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpService, deps: [{ token: i1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
165
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpService, providedIn: 'root' }); }
166
- }
167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpService, decorators: [{
168
- type: Injectable,
169
- args: [{ providedIn: 'root' }]
170
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }]; } });
171
-
172
- class AXHttpModule {
173
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
174
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.9", ngImport: i0, type: AXHttpModule, imports: [CommonModule,
175
- HttpClientModule], exports: [HttpClientModule] }); }
176
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpModule, providers: [
177
- AXHttpService
178
- ], imports: [CommonModule,
179
- HttpClientModule, HttpClientModule] }); }
180
- }
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXHttpModule, decorators: [{
182
- type: NgModule,
183
- args: [{
184
- declarations: [],
185
- imports: [
186
- CommonModule,
187
- HttpClientModule
188
- ],
189
- exports: [HttpClientModule],
190
- providers: [
191
- AXHttpService
192
- ]
193
- }]
194
- }] });
195
-
196
- /**
197
- * Generated bundle index. Do not edit.
198
- */
199
-
200
- export { AXHttpModule, AXHttpService, AX_HTTP_EVENT_INTERCEPTOR, HttpResult };
201
- //# sourceMappingURL=acorex-core-http.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-core-http.mjs","sources":["../../../../libs/core/http/src/lib/http-events.interceptor.ts","../../../../libs/core/http/src/lib/http-result.class.ts","../../../../libs/core/http/src/lib/http.service.ts","../../../../libs/core/http/src/lib/http.module.ts","../../../../libs/core/http/src/acorex-core-http.ts"],"sourcesContent":["import { IHttpError } from './http-error.class';\nimport { InjectionToken } from '@angular/core';\nimport { AXHttpRequestOptions } from './http-request.class';\n\nexport const AX_HTTP_EVENT_INTERCEPTOR = new InjectionToken<AXHttpEventInterceptor>('ax.http.events');\n\nexport interface AXHttpEventInterceptor {\n begin(request: AXHttpRequestOptions): Promise<AXHttpRequestOptions>;\n success(request: AXHttpRequestOptions, result: any): Promise<any>;\n complete(request: AXHttpRequestOptions);\n error(request: AXHttpRequestOptions, error: IHttpError);\n}\n\n\n","import { IHttpError } from './http-error.class';\n\nexport class HttpResult<T> {\n private _executor: (result: (e?: T) => void, error: (e?: IHttpError) => void, complete: () => void) => void;\n constructor(\n executor: (\n result: (e?: T) => void,\n error: (e?: IHttpError) => void,\n complete: () => void\n ) => void\n ) {\n this._executor = executor;\n setTimeout(() => {\n this._executor(this.resultAction, this.errorAction, this.completeAction);\n }, 50);\n }\n\n private resultAction: (e?: T) => void;\n private errorAction: (e?: IHttpError) => void;\n private completeAction: () => void;\n\n result(action: (e?: T) => void): HttpResult<T> { \n this.resultAction = action;\n return this;\n }\n error(action: (e?: IHttpError) => void): HttpResult<T> {\n this.errorAction = action;\n return this;\n }\n complete(action: () => void): HttpResult<T> {\n this.completeAction = action;\n return this;\n }\n}","import { Injectable, Injector, InjectFlags } from '@angular/core';\nimport { HttpClient, HttpHeaders, HttpParams, HttpErrorResponse } from '@angular/common/http';\nimport { HttpResult } from './http-result.class';\nimport { IHttpError } from './http-error.class';\nimport { AXHttpRequestOptions } from './http-request.class';\nimport {\n AX_HTTP_EVENT_INTERCEPTOR, AXHttpEventInterceptor\n} from './http-events.interceptor';\n// import { catchError, retry, retryWhen, mergeMap, delay, switchMap, scan, takeWhile, flatMap } from 'rxjs/operators';\n// import { of, concat, throwError } from 'rxjs';\n\n\n@Injectable({ providedIn: 'root' })\nexport class AXHttpService {\n\n private interceptor: AXHttpEventInterceptor;\n constructor(private http: HttpClient, private injector: Injector) {\n this.interceptor = this.injector.get(AX_HTTP_EVENT_INTERCEPTOR);\n }\n\n\n get<T>(url: string, config: AXHttpRequestOptions = {}): HttpResult<T> {\n config.url = url;\n config.method = \"get\";\n return this.request(config);\n }\n\n post<T>(url: string, config: AXHttpRequestOptions = {}): HttpResult<T> {\n config.url = url;\n config.method = \"post\";\n return this.request(config);\n }\n\n delete<T>(url: string, config: AXHttpRequestOptions = {}): HttpResult<T> {\n config.url = url;\n config.method = \"delete\";\n return this.request(config);\n }\n\n put<T>(url: string, config: AXHttpRequestOptions = {}): HttpResult<T> {\n config.url = url;\n config.method = \"put\";\n return this.request(config);\n }\n\n\n request<T>(config: AXHttpRequestOptions): HttpResult<T> {\n return new HttpResult<T>((result?, error?, complete?) => {\n this.handleBegin(config).then(c => {\n this.http\n //TODO: check ts error\n //@ts-ignore\n .request<T>(config.method, config.url, this.mapOptions(config))\n //.pipe(this.retry)\n .subscribe(data => {\n this.handleResult(data, result, complete, config);\n }, c => {\n this.handleError(c, error, complete, config);\n });\n });\n })\n }\n\n\n private handleResult(data, result, complete, config: AXHttpRequestOptions) {\n if (this.interceptor) {\n this.interceptor.success(config, data).then(c => {\n if (result)\n result(c);\n this.handleComplete(complete, config);\n });\n }\n else {\n //\n if (result)\n result(data);\n this.handleComplete(complete, config);\n }\n }\n\n private handleBegin(config: AXHttpRequestOptions): Promise<AXHttpRequestOptions> {\n return new Promise((resolve) => {\n if (!config.headers)\n config.headers = {};\n if (!config.params)\n config.params = {};\n //\n if (this.interceptor) {\n this.interceptor.begin(config).then(c => {\n resolve(c);\n });\n }\n else {\n resolve(config)\n }\n })\n }\n\n private handleComplete(complete: Function, config: AXHttpRequestOptions) {\n if (complete)\n complete();\n if (this.interceptor)\n this.interceptor.complete(config);\n }\n\n private handleError(c: HttpErrorResponse, error: Function, complete: Function, config: AXHttpRequestOptions) {\n let r: IHttpError = {\n message: c.message,\n status: c.status,\n code: c.status?.toString(),\n handled: false,\n error: c.error\n }\n if (error) {\n error(r);\n }\n if (!r.handled) {\n if (this.interceptor)\n this.interceptor.error(config, r);\n }\n this.handleComplete(complete, config);\n }\n\n private mapOptions(options: AXHttpRequestOptions) {\n let headers = new HttpHeaders();\n\n for (const key in options.headers) {\n if (options.headers.hasOwnProperty(key)) {\n const value = options.headers[key];\n headers = headers.set(key, value)\n }\n }\n let params = new HttpParams();\n for (const key in options.params) {\n if (options.params.hasOwnProperty(key)) {\n const value = options.params[key];\n params = params.set(key, value);\n }\n }\n return {\n headers: headers,\n params: params,\n body: options.body,\n responseType: options.responseType || 'json'\n };\n // if (options.method == \"get\") {\n // return {\n // headers: headers,\n // params: params\n // };\n // }\n // else {\n // return {\n // headers: headers,\n // params: params,\n // body: options.body\n // };\n // }\n }\n\n}","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { AXHttpService } from './http.service';\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n HttpClientModule\n ],\n exports: [HttpClientModule],\n providers: [\n AXHttpService\n ]\n})\nexport class AXHttpModule {\n // static forRoot(): ModuleWithProviders {\n // return {\n // ngModule: AXHttpModule,\n // providers: [AXHttpService]\n // };\n // }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,yBAAyB,GAAG,IAAI,cAAc,CAAyB,gBAAgB;;MCFvF,UAAU,CAAA;AAEnB,IAAA,WAAA,CACI,QAIS,EAAA;AAET,QAAA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,UAAU,CAAC,MAAK;AACZ,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SAC5E,EAAE,EAAE,CAAC,CAAC;KACV;AAMD,IAAA,MAAM,CAAC,MAAuB,EAAA;AAC1B,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;AAC3B,QAAA,OAAO,IAAI,CAAC;KACf;AAC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Y,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;AACjB,qBAAA;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC3B,oBAAA,SAAS,EAAE;wBACT,aAAa;AACd,qBAAA;AACF,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
package/http/README.md DELETED
@@ -1,3 +0,0 @@
1
- # @acorex/core/http
2
-
3
- Secondary entry point of `@acorex/core`. It can be used by importing from `@acorex/core/http`.
package/http/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './lib/http-error.class';
2
- export * from './lib/http-events.interceptor';
3
- export * from './lib/http-request.class';
4
- export * from './lib/http-result.class';
5
- export * from './lib/http.module';
6
- export * from './lib/http.service';
@@ -1,7 +0,0 @@
1
- export interface IHttpError {
2
- message?: string;
3
- status?: number;
4
- code?: string;
5
- handled: boolean;
6
- error: any | null;
7
- }
@@ -1,10 +0,0 @@
1
- import { IHttpError } from './http-error.class';
2
- import { InjectionToken } from '@angular/core';
3
- import { AXHttpRequestOptions } from './http-request.class';
4
- export declare const AX_HTTP_EVENT_INTERCEPTOR: InjectionToken<AXHttpEventInterceptor>;
5
- export interface AXHttpEventInterceptor {
6
- begin(request: AXHttpRequestOptions): Promise<AXHttpRequestOptions>;
7
- success(request: AXHttpRequestOptions, result: any): Promise<any>;
8
- complete(request: AXHttpRequestOptions): any;
9
- error(request: AXHttpRequestOptions, error: IHttpError): any;
10
- }
@@ -1,14 +0,0 @@
1
- export interface AXHttpRequestOptions {
2
- url?: any;
3
- params?: {
4
- [param: string]: any;
5
- };
6
- body?: {
7
- [param: string]: any;
8
- };
9
- headers?: {
10
- [header: string]: any;
11
- };
12
- method?: 'get' | 'post' | 'put' | 'delete';
13
- responseType?: any;
14
- }
@@ -1,11 +0,0 @@
1
- import { IHttpError } from './http-error.class';
2
- export declare class HttpResult<T> {
3
- private _executor;
4
- constructor(executor: (result: (e?: T) => void, error: (e?: IHttpError) => void, complete: () => void) => void);
5
- private resultAction;
6
- private errorAction;
7
- private completeAction;
8
- result(action: (e?: T) => void): HttpResult<T>;
9
- error(action: (e?: IHttpError) => void): HttpResult<T>;
10
- complete(action: () => void): HttpResult<T>;
11
- }
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- import * as i2 from "@angular/common/http";
4
- export declare class AXHttpModule {
5
- static ɵfac: i0.ɵɵFactoryDeclaration<AXHttpModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<AXHttpModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule], [typeof i2.HttpClientModule]>;
7
- static ɵinj: i0.ɵɵInjectorDeclaration<AXHttpModule>;
8
- }
@@ -1,23 +0,0 @@
1
- import { Injector } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { HttpResult } from './http-result.class';
4
- import { AXHttpRequestOptions } from './http-request.class';
5
- import * as i0 from "@angular/core";
6
- export declare class AXHttpService {
7
- private http;
8
- private injector;
9
- private interceptor;
10
- constructor(http: HttpClient, injector: Injector);
11
- get<T>(url: string, config?: AXHttpRequestOptions): HttpResult<T>;
12
- post<T>(url: string, config?: AXHttpRequestOptions): HttpResult<T>;
13
- delete<T>(url: string, config?: AXHttpRequestOptions): HttpResult<T>;
14
- put<T>(url: string, config?: AXHttpRequestOptions): HttpResult<T>;
15
- request<T>(config: AXHttpRequestOptions): HttpResult<T>;
16
- private handleResult;
17
- private handleBegin;
18
- private handleComplete;
19
- private handleError;
20
- private mapOptions;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<AXHttpService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<AXHttpService>;
23
- }