@acorex/core 7.17.14 → 7.17.16
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/dateTime/lib/datetime-formatter.d.ts +15 -0
- package/dateTime/lib/datetime.module.d.ts +4 -1
- package/esm2022/config/lib/configs.service.mjs +3 -3
- package/esm2022/dateTime/lib/calendar.service.mjs +3 -3
- package/esm2022/dateTime/lib/datetime-formatter.mjs +109 -0
- package/esm2022/dateTime/lib/datetime.module.mjs +13 -27
- package/esm2022/dateTime/lib/datetime.pipe.mjs +3 -3
- package/esm2022/events/lib/event.service.mjs +3 -3
- package/esm2022/file/index.mjs +3 -1
- package/esm2022/file/lib/file-size-formatter.mjs +24 -0
- package/esm2022/file/lib/file.module.mjs +22 -0
- package/esm2022/file/lib/file.service.mjs +8 -5
- package/esm2022/format/index.mjs +2 -2
- package/esm2022/format/lib/format.config.mjs +2 -3
- package/esm2022/format/lib/format.module.mjs +30 -33
- package/esm2022/format/lib/format.pipe.mjs +3 -3
- package/esm2022/format/lib/format.service.mjs +30 -14
- package/esm2022/format/lib/number-formatter.mjs +16 -0
- package/esm2022/format/lib/string-formatter.mjs +26 -0
- package/esm2022/image/lib/image.service.mjs +3 -3
- package/esm2022/pipes/lib/safe/safe.pipe.mjs +3 -3
- package/esm2022/platform/lib/platform.service.mjs +3 -3
- package/esm2022/storage/cookie-storage.service.mjs +3 -3
- package/esm2022/storage/local-storage.service.mjs +3 -3
- package/esm2022/storage/session-storage.service.mjs +3 -3
- package/esm2022/translation/lib/translation.module.mjs +4 -4
- package/esm2022/translation/lib/translator.pipe.mjs +3 -3
- package/esm2022/utils/lib/auto-unsubscribe.mjs +3 -3
- package/fesm2022/acorex-core-config.mjs +3 -3
- package/fesm2022/acorex-core-dateTime.mjs +109 -35
- package/fesm2022/acorex-core-dateTime.mjs.map +1 -1
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-file.mjs +50 -7
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +59 -48
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +3 -3
- package/fesm2022/acorex-core-pipes.mjs +3 -3
- package/fesm2022/acorex-core-platform.mjs +3 -3
- package/fesm2022/acorex-core-storage.mjs +9 -9
- package/fesm2022/acorex-core-translation.mjs +7 -7
- package/fesm2022/acorex-core-utils.mjs +3 -3
- package/file/index.d.ts +2 -0
- package/file/lib/file-size-formatter.d.ts +8 -0
- package/file/lib/file.module.d.ts +8 -0
- package/format/index.d.ts +1 -1
- package/format/lib/format.config.d.ts +1 -3
- package/format/lib/format.module.d.ts +7 -0
- package/format/lib/format.service.d.ts +10 -3
- package/format/lib/number-formatter.d.ts +5 -0
- package/format/lib/string-formatter.d.ts +5 -0
- package/package.json +3 -3
- package/dateTime/lib/datetime-format.plugin.d.ts +0 -9
- package/esm2022/dateTime/lib/datetime-format.plugin.mjs +0 -21
- package/esm2022/format/lib/number-format.plugin.mjs +0 -16
- package/esm2022/format/lib/string-format.plugin.mjs +0 -26
- package/format/lib/number-format.plugin.d.ts +0 -5
- package/format/lib/string-format.plugin.d.ts +0 -5
@@ -1,28 +1,43 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
3
|
-
|
4
|
-
const AX_FORMAT_PLUGING = new InjectionToken('format.plugin');
|
2
|
+
import { Injectable, inject, Pipe, APP_INITIALIZER, NgModule } from '@angular/core';
|
5
3
|
|
4
|
+
class AXFormatterRegistryService {
|
5
|
+
constructor() {
|
6
|
+
this.plugins = [];
|
7
|
+
}
|
8
|
+
register(...plugin) {
|
9
|
+
this.plugins.push(...plugin.filter(p => !this.plugins.some(c => c.name == p.name)));
|
10
|
+
}
|
11
|
+
get formatters() {
|
12
|
+
return this.plugins;
|
13
|
+
}
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatterRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
15
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatterRegistryService, providedIn: 'root' }); }
|
16
|
+
}
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatterRegistryService, decorators: [{
|
18
|
+
type: Injectable,
|
19
|
+
args: [{
|
20
|
+
providedIn: 'root'
|
21
|
+
}]
|
22
|
+
}] });
|
6
23
|
class AXFormatService {
|
7
|
-
constructor(
|
8
|
-
this.
|
24
|
+
constructor(pluginRegistry) {
|
25
|
+
this.pluginRegistry = pluginRegistry;
|
9
26
|
}
|
10
27
|
format(value, name, ...args) {
|
11
|
-
const format = this.
|
12
|
-
if (!
|
28
|
+
const format = this.pluginRegistry.formatters.find((c) => c.name == name);
|
29
|
+
if (!format) {
|
13
30
|
return String(value);
|
31
|
+
}
|
14
32
|
return format.format(value, ...args);
|
15
33
|
}
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
17
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatService, deps: [{ token: AXFormatterRegistryService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatService, providedIn: 'root' }); }
|
18
36
|
}
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatService, decorators: [{
|
20
38
|
type: Injectable,
|
21
39
|
args: [{ providedIn: 'root' }]
|
22
|
-
}], ctorParameters: () => [{ type:
|
23
|
-
type: Inject,
|
24
|
-
args: [AX_FORMAT_PLUGING]
|
25
|
-
}] }] });
|
40
|
+
}], ctorParameters: () => [{ type: AXFormatterRegistryService }] });
|
26
41
|
|
27
42
|
class AXFormatPipe {
|
28
43
|
constructor() {
|
@@ -32,10 +47,10 @@ class AXFormatPipe {
|
|
32
47
|
const name = args[0];
|
33
48
|
return this.formatService.format(value, name, ...args.slice(1));
|
34
49
|
}
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
36
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
51
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AXFormatPipe, name: "format" }); }
|
37
52
|
}
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatPipe, decorators: [{
|
39
54
|
type: Pipe,
|
40
55
|
args: [{
|
41
56
|
name: 'format',
|
@@ -43,7 +58,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
43
58
|
}]
|
44
59
|
}] });
|
45
60
|
|
46
|
-
class
|
61
|
+
class AXNumberFormatter {
|
47
62
|
get name() {
|
48
63
|
return 'number';
|
49
64
|
}
|
@@ -59,7 +74,7 @@ class AXNumberFormatPlugin {
|
|
59
74
|
}
|
60
75
|
}
|
61
76
|
|
62
|
-
class
|
77
|
+
class AXStringFormatter {
|
63
78
|
get name() {
|
64
79
|
return 'string';
|
65
80
|
}
|
@@ -86,45 +101,41 @@ class AXStringFormatPlugin {
|
|
86
101
|
}
|
87
102
|
|
88
103
|
class AXFormatModule {
|
89
|
-
static
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
104
|
+
static forRoot(config) {
|
105
|
+
return {
|
106
|
+
ngModule: AXFormatModule,
|
107
|
+
providers: [
|
108
|
+
{
|
109
|
+
provide: APP_INITIALIZER,
|
110
|
+
useFactory: (pluginRegistry) => () => {
|
111
|
+
if (config?.formatters?.length)
|
112
|
+
pluginRegistry.register(...config.formatters);
|
113
|
+
},
|
114
|
+
deps: [AXFormatterRegistryService],
|
115
|
+
multi: true
|
116
|
+
}
|
117
|
+
]
|
118
|
+
};
|
119
|
+
}
|
120
|
+
constructor(pluginRegistry) {
|
121
|
+
pluginRegistry.register(new AXNumberFormatter(), new AXStringFormatter());
|
122
|
+
}
|
123
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatModule, deps: [{ token: AXFormatterRegistryService }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
124
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AXFormatModule, declarations: [AXFormatPipe], exports: [AXFormatPipe] }); }
|
125
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatModule }); }
|
103
126
|
}
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXFormatModule, decorators: [{
|
105
128
|
type: NgModule,
|
106
129
|
args: [{
|
107
130
|
imports: [],
|
108
131
|
exports: [AXFormatPipe],
|
109
132
|
declarations: [AXFormatPipe],
|
110
|
-
providers: [
|
111
|
-
{
|
112
|
-
provide: AX_FORMAT_PLUGING,
|
113
|
-
multi: true,
|
114
|
-
useClass: AXNumberFormatPlugin,
|
115
|
-
},
|
116
|
-
{
|
117
|
-
provide: AX_FORMAT_PLUGING,
|
118
|
-
multi: true,
|
119
|
-
useClass: AXStringFormatPlugin,
|
120
|
-
},
|
121
|
-
],
|
122
133
|
}]
|
123
|
-
}] });
|
134
|
+
}], ctorParameters: () => [{ type: AXFormatterRegistryService }] });
|
124
135
|
|
125
136
|
/**
|
126
137
|
* Generated bundle index. Do not edit.
|
127
138
|
*/
|
128
139
|
|
129
|
-
export { AXFormatModule, AXFormatPipe, AXFormatService,
|
140
|
+
export { AXFormatModule, AXFormatPipe, AXFormatService, AXFormatterRegistryService, AXNumberFormatter };
|
130
141
|
//# sourceMappingURL=acorex-core-format.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-format.mjs","sources":["../../../../libs/core/format/src/lib/format.
|
1
|
+
{"version":3,"file":"acorex-core-format.mjs","sources":["../../../../libs/core/format/src/lib/format.service.ts","../../../../libs/core/format/src/lib/format.pipe.ts","../../../../libs/core/format/src/lib/number-formatter.ts","../../../../libs/core/format/src/lib/string-formatter.ts","../../../../libs/core/format/src/lib/format.module.ts","../../../../libs/core/format/src/acorex-core-format.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXFormatter } from './format.config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AXFormatterRegistryService {\n private plugins: AXFormatter[] = [];\n\n\n register(...plugin: AXFormatter[]) {\n this.plugins.push(...plugin.filter(p => !this.plugins.some(c => c.name == p.name)));\n }\n\n get formatters(): AXFormatter[] {\n return this.plugins;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXFormatService {\n constructor(\n private pluginRegistry: AXFormatterRegistryService\n ) { }\n\n format(value: unknown, name: string, ...args: unknown[]): string {\n const format = this.pluginRegistry.formatters.find((c) => c.name == name);\n if (!format) {\n return String(value);\n }\n return format.format(value, ...args);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { AXFormatService } from './format.service';\n\n@Pipe({\n name: 'format',\n pure: true,\n})\nexport class AXFormatPipe implements PipeTransform {\n private formatService = inject(AXFormatService);\n\n transform(value: unknown, ...args: unknown[]): string {\n const name = args[0] as string;\n return this.formatService.format(value, name, ...args.slice(1));\n }\n}\n","import { AXFormatter } from './format.config';\n\nexport class AXNumberFormatter implements AXFormatter {\n get name(): string {\n return 'number';\n }\n\n format(value: unknown, ...args: unknown[]): string {\n const formatStr: string = (args.length ? args[0] : null) as string;\n if (formatStr?.match(/^.{2}-.{2}$/)) {\n return Number(value).toLocaleString(formatStr);\n }\n if (formatStr?.match(/^D\\d+$/)) {\n return String(value).padStart(Number(formatStr.slice(1)), '0');\n }\n return String(value);\n }\n}\n","import { AXFormatter } from './format.config';\n\nexport class AXStringFormatter implements AXFormatter {\n get name(): string {\n return 'string';\n }\n\n format(value: unknown, ...args: unknown[]): string {\n if (typeof value != 'string') return String(value);\n const data: string = (args.length ? args[0] : null) as string;\n const result = value.replace(/{{\\s*([^}]+)\\s*}}/g, (match, variable) => {\n // if (variable?.match(/^\\w+:\\w+:\\w+$/g)) {\n //\n // const formatData = data[variable[0]];\n // const formatType = data[variable[1]];\n // const formatArg = data[variable[2]];\n // const value = this.formatService.format(formatData, formatType, formatArg);\n // return value ?? match;\n // }\n // else {\n const value = data[variable] as string;\n return value ?? match;\n // }\n });\n return result;\n }\n\n // private format(inputString: string, data: { [key: string]: string }): string {\n // return inputString.replace(/{{\\s*([^}]+)\\s*}}/g, (match, variable) => {\n // const value = data[variable];\n // return value !== undefined ? value : match;\n // });\n // }\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';\nimport { AXFormatPipe } from './format.pipe';\nimport { AXNumberFormatter } from './number-formatter';\nimport { AXStringFormatter } from './string-formatter';\nimport { AXFormatterRegistryService } from './format.service';\nimport { AXFormatter } from './format.config';\n\n\n@NgModule({\n imports: [],\n exports: [AXFormatPipe],\n declarations: [AXFormatPipe],\n})\nexport class AXFormatModule {\n\n static forRoot(config?: { formatters?: AXFormatter[] }): ModuleWithProviders<AXFormatModule> {\n return {\n ngModule: AXFormatModule,\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: (pluginRegistry: AXFormatterRegistryService) => () => {\n if (config?.formatters?.length)\n pluginRegistry.register(...config.formatters);\n },\n deps: [AXFormatterRegistryService],\n multi: true\n }\n ]\n };\n }\n\n constructor(pluginRegistry: AXFormatterRegistryService) {\n pluginRegistry.register(new AXNumberFormatter(), new AXStringFormatter())\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AXFormatterRegistryService"],"mappings":";;;MAMa,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAO,CAAA,OAAA,GAAkB,EAAE,CAAC;AAUrC,KAAA;IAPC,QAAQ,CAAC,GAAG,MAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACrF;AAED,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;8GAVU,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,E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,EAAA,CAAA,EAAA,KAAA,EAAAA,0BAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAd,cAAc,EAAA,YAAA,EAAA,CAFV,YAAY,CAAA,EAAA,OAAA,EAAA,CADjB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGX,cAAc,EAAA,CAAA,CAAA,EAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,YAAY,CAAC;AAC7B,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
@@ -35,10 +35,10 @@ class AXImageService {
|
|
35
35
|
canvas.getContext('2d').drawImage(image, 0, 0, width, height);
|
36
36
|
return new Promise((resolve) => canvas.toBlob(resolve, options.type, options.quality));
|
37
37
|
}
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
39
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXImageService }); }
|
40
40
|
}
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXImageService, decorators: [{
|
42
42
|
type: Injectable
|
43
43
|
}] });
|
44
44
|
|
@@ -24,10 +24,10 @@ class AXSafePipe {
|
|
24
24
|
throw new Error(`Invalid safe type specified: ${type}`);
|
25
25
|
}
|
26
26
|
}
|
27
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
28
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXSafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
28
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AXSafePipe, isStandalone: true, name: "safe" }); }
|
29
29
|
}
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXSafePipe, decorators: [{
|
31
31
|
type: Pipe,
|
32
32
|
args: [{
|
33
33
|
name: 'safe',
|
@@ -209,10 +209,10 @@ class AXPlatform {
|
|
209
209
|
// init functions
|
210
210
|
this._setFullHeightRatio();
|
211
211
|
}
|
212
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
213
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
212
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
213
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXPlatform, providedIn: 'root' }); }
|
214
214
|
}
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXPlatform, decorators: [{
|
216
216
|
type: Injectable,
|
217
217
|
args: [{
|
218
218
|
providedIn: 'root',
|
@@ -181,10 +181,10 @@ class AXCookieStorageService {
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
}
|
184
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
185
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXCookieStorageService, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
185
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXCookieStorageService }); }
|
186
186
|
}
|
187
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXCookieStorageService, decorators: [{
|
188
188
|
type: Injectable
|
189
189
|
}], ctorParameters: () => [{ type: Document, decorators: [{
|
190
190
|
type: Inject,
|
@@ -207,10 +207,10 @@ class AXLocalStorageService {
|
|
207
207
|
removeItem(key) {
|
208
208
|
return localStorage.removeItem(key);
|
209
209
|
}
|
210
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
211
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
210
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXLocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
211
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXLocalStorageService }); }
|
212
212
|
}
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXLocalStorageService, decorators: [{
|
214
214
|
type: Injectable
|
215
215
|
}] });
|
216
216
|
|
@@ -227,10 +227,10 @@ class AXSessionStorageService {
|
|
227
227
|
removeItem(key) {
|
228
228
|
return sessionStorage.removeItem(key);
|
229
229
|
}
|
230
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
231
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXSessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
231
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXSessionStorageService }); }
|
232
232
|
}
|
233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXSessionStorageService, decorators: [{
|
234
234
|
type: Injectable
|
235
235
|
}] });
|
236
236
|
|
@@ -47,20 +47,20 @@ class AXTranslatorPipe {
|
|
47
47
|
transform(value, arg1, arg2) {
|
48
48
|
return AXTranslator.get(value, arg1, arg2);
|
49
49
|
}
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
51
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
51
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AXTranslatorPipe, name: "trans" }); }
|
52
52
|
}
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXTranslatorPipe, decorators: [{
|
54
54
|
type: Pipe,
|
55
55
|
args: [{ name: 'trans', pure: true }]
|
56
56
|
}] });
|
57
57
|
|
58
58
|
class AXTranslationModule {
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
60
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.
|
61
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
60
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] }); }
|
61
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXTranslationModule }); }
|
62
62
|
}
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXTranslationModule, decorators: [{
|
64
64
|
type: NgModule,
|
65
65
|
args: [{
|
66
66
|
imports: [],
|
@@ -30,10 +30,10 @@ class AXUnsubscriber {
|
|
30
30
|
ngOnDestroy() {
|
31
31
|
this.unsubscribe();
|
32
32
|
}
|
33
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
34
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXUnsubscriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
34
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXUnsubscriber }); }
|
35
35
|
}
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AXUnsubscriber, decorators: [{
|
37
37
|
type: Injectable
|
38
38
|
}] });
|
39
39
|
|
package/file/index.d.ts
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AXFormatter } from '@acorex/core/format';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class AXFileSizeFormatter implements AXFormatter {
|
4
|
+
get name(): string;
|
5
|
+
format(value: unknown, ...args: unknown[]): string;
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileSizeFormatter, never>;
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFileSizeFormatter>;
|
8
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AXFormatterRegistryService } from '@acorex/core/format';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class AXFileModule {
|
4
|
+
constructor(service: AXFormatterRegistryService);
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFileModule, never>;
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, never, never>;
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXFileModule>;
|
8
|
+
}
|
package/format/index.d.ts
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
export interface AXFormatPlugin {
|
1
|
+
export interface AXFormatter {
|
3
2
|
get name(): string;
|
4
3
|
format(value: unknown, ...args: unknown[]): string;
|
5
4
|
}
|
6
|
-
export declare const AX_FORMAT_PLUGING: InjectionToken<AXFormatPlugin>;
|
@@ -1,6 +1,13 @@
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
2
|
+
import { AXFormatterRegistryService } from './format.service';
|
3
|
+
import { AXFormatter } from './format.config';
|
1
4
|
import * as i0 from "@angular/core";
|
2
5
|
import * as i1 from "./format.pipe";
|
3
6
|
export declare class AXFormatModule {
|
7
|
+
static forRoot(config?: {
|
8
|
+
formatters?: AXFormatter[];
|
9
|
+
}): ModuleWithProviders<AXFormatModule>;
|
10
|
+
constructor(pluginRegistry: AXFormatterRegistryService);
|
4
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatModule, never>;
|
5
12
|
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFormatModule, [typeof i1.AXFormatPipe], never, [typeof i1.AXFormatPipe]>;
|
6
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXFormatModule>;
|
@@ -1,8 +1,15 @@
|
|
1
|
-
import {
|
1
|
+
import { AXFormatter } from './format.config';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
export declare class
|
3
|
+
export declare class AXFormatterRegistryService {
|
4
4
|
private plugins;
|
5
|
-
|
5
|
+
register(...plugin: AXFormatter[]): void;
|
6
|
+
get formatters(): AXFormatter[];
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatterRegistryService, never>;
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXFormatterRegistryService>;
|
9
|
+
}
|
10
|
+
export declare class AXFormatService {
|
11
|
+
private pluginRegistry;
|
12
|
+
constructor(pluginRegistry: AXFormatterRegistryService);
|
6
13
|
format(value: unknown, name: string, ...args: unknown[]): string;
|
7
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatService, never>;
|
8
15
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFormatService>;
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@acorex/core",
|
3
|
-
"version": "7.17.
|
3
|
+
"version": "7.17.16",
|
4
4
|
"sideEffects": false,
|
5
5
|
"peerDependencies": {
|
6
|
-
"@angular/common": ">=17.0.
|
7
|
-
"@angular/core": ">=17.0.
|
6
|
+
"@angular/common": ">=17.0.3",
|
7
|
+
"@angular/core": ">=17.0.3",
|
8
8
|
"lodash-es": ">=4.17.21",
|
9
9
|
"tinycolor2": ">=1.6.0",
|
10
10
|
"tinygradient-es": ">=1.0.0"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { AXFormatPlugin } from '@acorex/core/format';
|
2
|
-
import * as i0 from "@angular/core";
|
3
|
-
export declare class AXDateTimeFormatPlugin implements AXFormatPlugin {
|
4
|
-
private calendarService;
|
5
|
-
get name(): string;
|
6
|
-
format(value: unknown, ...args: unknown[]): string;
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXDateTimeFormatPlugin, never>;
|
8
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXDateTimeFormatPlugin>;
|
9
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { Injectable, inject } from '@angular/core';
|
2
|
-
import { AXCalendarService } from './calendar.service';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
export class AXDateTimeFormatPlugin {
|
5
|
-
constructor() {
|
6
|
-
this.calendarService = inject(AXCalendarService);
|
7
|
-
}
|
8
|
-
get name() {
|
9
|
-
return 'datetime';
|
10
|
-
}
|
11
|
-
format(value, ...args) {
|
12
|
-
const formatStr = (args.length ? args[0] : null);
|
13
|
-
return this.calendarService.create(value).format(formatStr);
|
14
|
-
}
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: AXDateTimeFormatPlugin, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
16
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: AXDateTimeFormatPlugin }); }
|
17
|
-
}
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: AXDateTimeFormatPlugin, decorators: [{
|
19
|
-
type: Injectable
|
20
|
-
}] });
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUtZm9ybWF0LnBsdWdpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9kYXRlVGltZS9zcmMvbGliL2RhdGV0aW1lLWZvcm1hdC5wbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7O0FBR3ZELE1BQU0sT0FBTyxzQkFBc0I7SUFEbkM7UUFFVSxvQkFBZSxHQUFHLE1BQU0sQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0tBVXJEO0lBUkMsSUFBSSxJQUFJO1FBQ04sT0FBTyxVQUFVLENBQUM7SUFDcEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQUFjLEVBQUUsR0FBRyxJQUFlO1FBQ3ZDLE1BQU0sU0FBUyxHQUFXLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FB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ormatPlugin {
|
2
|
-
get name() {
|
3
|
-
return 'number';
|
4
|
-
}
|
5
|
-
format(value, ...args) {
|
6
|
-
const formatStr = (args.length ? args[0] : null);
|
7
|
-
if (formatStr?.match(/^.{2}-.{2}$/)) {
|
8
|
-
return Number(value).toLocaleString(formatStr);
|
9
|
-
}
|
10
|
-
if (formatStr?.match(/^D\d+$/)) {
|
11
|
-
return String(value).padStart(Number(formatStr.slice(1)), '0');
|
12
|
-
}
|
13
|
-
return String(value);
|
14
|
-
}
|
15
|
-
}
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyLWZvcm1hdC5wbHVnaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvZm9ybWF0L3NyYy9saWIvbnVtYmVyLWZvcm1hdC5wbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLG9CQUFvQjtJQUMvQixJQUFJLElBQUk7UUFDTixPQUFPLFFBQVEsQ0FBQztJQUNsQixDQUFDO0lBRUQsTUFBTSxDQUFDLEtBQWMsRUFBRSxHQUFHLElBQWU7UUFDdkMsTUFBTSxTQUFTLEdBQVcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBVyxDQUFDO1FBQ25FLElBQUksU0FBUyxFQUFFLEtBQUssQ0FBQyxhQUFhLENBQUMsRUFBRTtZQUNuQyxPQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLENBQUM7U0FDaEQ7UUFDRCxJQUFJLFNBQVMsRUFBRSxLQUFLLENBQUMsUUFBUSxDQUFDLEVBQUU7WUFDOUIsT0FBTyxNQUFNLENBQUMsS0FBSy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
|
6
|
-
if (typeof value != 'string')
|
7
|
-
return String(value);
|
8
|
-
const data = (args.length ? args[0] : null);
|
9
|
-
const result = value.replace(/{{\s*([^}]+)\s*}}/g, (match, variable) => {
|
10
|
-
// if (variable?.match(/^\w+:\w+:\w+$/g)) {
|
11
|
-
//
|
12
|
-
// const formatData = data[variable[0]];
|
13
|
-
// const formatType = data[variable[1]];
|
14
|
-
// const formatArg = data[variable[2]];
|
15
|
-
// const value = this.formatService.format(formatData, formatType, formatArg);
|
16
|
-
// return value ?? match;
|
17
|
-
// }
|
18
|
-
// else {
|
19
|
-
const value = data[variable];
|
20
|
-
return value ?? match;
|
21
|
-
// }
|
22
|
-
});
|
23
|
-
return result;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5nLWZvcm1hdC5wbHVnaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvZm9ybWF0L3NyYy9saWIvc3RyaW5nLWZvcm1hdC5wbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLG9CQUFvQjtJQUMvQixJQUFJLElBQUk7UUFDTixPQUFPLFFBQVEsQ0FBQztJQUNsQixDQUFDO0lBRUQsTUFBTSxDQUFDLEtBQWMsRUFBRSxHQUFHLElBQWU7UUFDdkMsSUFBSSxPQUFPLEtBQUssSUFBSSxRQUFRO1lBQUUsT0FBTyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDbkQsTUFBTSxJQUFJLEdBQVcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBVyxDQUFDO1FBQzlELE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxPQUF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