@acorex/core 19.13.0-next.0 → 19.13.0-next.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.
- package/fesm2022/acorex-core-components.mjs +3 -3
- package/fesm2022/acorex-core-config.mjs +3 -3
- package/fesm2022/acorex-core-date-time.mjs +25 -25
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-file.mjs +10 -10
- package/fesm2022/acorex-core-format.mjs +36 -35
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +3 -3
- package/fesm2022/acorex-core-locale.mjs +10 -10
- package/fesm2022/acorex-core-network.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 +245 -213
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +143 -18
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +40 -40
- package/format/lib/format.service.d.ts +8 -7
- package/package.json +1 -1
- package/translation/index.d.ts +1 -1
- package/translation/lib/translation-loader.service.d.ts +20 -0
- package/translation/lib/translation.config.d.ts +19 -6
- package/translation/lib/translation.loader.d.ts +2 -2
- package/translation/lib/translation.parser.d.ts +7 -0
- package/translation/lib/translation.resolver.d.ts +9 -0
- package/translation/lib/translation.service.d.ts +12 -32
- package/translation/lib/translation.types.d.ts +8 -2
- package/translation/lib/translator.pipe.d.ts +0 -2
- package/utils/index.d.ts +6 -5
- package/utils/lib/execution.utils.d.ts +33 -0
- package/utils/lib/string.utils.d.ts +4 -0
- package/utils/lib/string-util.d.ts +0 -6
- /package/utils/lib/{color-util.d.ts → color.utils.d.ts} +0 -0
- /package/utils/lib/{drawing-util.d.ts → drawing.utils.d.ts} +0 -0
- /package/utils/lib/{html-util.d.ts → html-utils.d.ts} +0 -0
- /package/utils/lib/{auto-unsubscribe.d.ts → lifecycle-helpers.utils.d.ts} +0 -0
@@ -31,10 +31,10 @@ class AXCallbackValidationRule {
|
|
31
31
|
}
|
32
32
|
return createResult(validationResult);
|
33
33
|
}
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
35
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXCallbackValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXCallbackValidationRule }); }
|
36
36
|
}
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXCallbackValidationRule, decorators: [{
|
38
38
|
type: Injectable
|
39
39
|
}] });
|
40
40
|
|
@@ -73,10 +73,10 @@ class AXRegexValidationRule {
|
|
73
73
|
value: value,
|
74
74
|
};
|
75
75
|
}
|
76
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
77
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRegexValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
77
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRegexValidationRule }); }
|
78
78
|
}
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRegexValidationRule, decorators: [{
|
80
80
|
type: Injectable
|
81
81
|
}] });
|
82
82
|
|
@@ -108,10 +108,10 @@ class AXRequiredValidationRule {
|
|
108
108
|
value,
|
109
109
|
};
|
110
110
|
}
|
111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
112
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRequiredValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
112
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRequiredValidationRule }); }
|
113
113
|
}
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXRequiredValidationRule, decorators: [{
|
115
115
|
type: Injectable
|
116
116
|
}] });
|
117
117
|
|
@@ -129,10 +129,10 @@ class AXLengthValidationRule {
|
|
129
129
|
value: value,
|
130
130
|
};
|
131
131
|
}
|
132
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
133
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
132
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
133
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLengthValidationRule }); }
|
134
134
|
}
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLengthValidationRule, decorators: [{
|
136
136
|
type: Injectable
|
137
137
|
}] });
|
138
138
|
|
@@ -150,10 +150,10 @@ class AXMaxLengthValidationRule {
|
|
150
150
|
value: value,
|
151
151
|
};
|
152
152
|
}
|
153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
154
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
153
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMaxLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
154
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMaxLengthValidationRule }); }
|
155
155
|
}
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMaxLengthValidationRule, decorators: [{
|
157
157
|
type: Injectable
|
158
158
|
}] });
|
159
159
|
|
@@ -170,10 +170,10 @@ class AXMinLengthValidationRule {
|
|
170
170
|
value: value,
|
171
171
|
};
|
172
172
|
}
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
174
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
173
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMinLengthValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
174
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMinLengthValidationRule }); }
|
175
175
|
}
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXMinLengthValidationRule, decorators: [{
|
177
177
|
type: Injectable
|
178
178
|
}] });
|
179
179
|
|
@@ -198,10 +198,10 @@ class AXBetweenValidationRule {
|
|
198
198
|
value: value,
|
199
199
|
};
|
200
200
|
}
|
201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
202
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXBetweenValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
202
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXBetweenValidationRule }); }
|
203
203
|
}
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXBetweenValidationRule, decorators: [{
|
205
205
|
type: Injectable
|
206
206
|
}] });
|
207
207
|
|
@@ -221,10 +221,10 @@ class AXEqualValidationRule {
|
|
221
221
|
value: value,
|
222
222
|
};
|
223
223
|
}
|
224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
225
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
224
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXEqualValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
225
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXEqualValidationRule }); }
|
226
226
|
}
|
227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXEqualValidationRule, decorators: [{
|
228
228
|
type: Injectable
|
229
229
|
}] });
|
230
230
|
|
@@ -243,10 +243,10 @@ class AXGreaterThanValidationRule {
|
|
243
243
|
value: value,
|
244
244
|
};
|
245
245
|
}
|
246
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
247
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXGreaterThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
247
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXGreaterThanValidationRule }); }
|
248
248
|
}
|
249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXGreaterThanValidationRule, decorators: [{
|
250
250
|
type: Injectable
|
251
251
|
}] });
|
252
252
|
|
@@ -265,10 +265,10 @@ class AXLessThanValidationRule {
|
|
265
265
|
value: value,
|
266
266
|
};
|
267
267
|
}
|
268
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
269
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLessThanValidationRule, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
269
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLessThanValidationRule }); }
|
270
270
|
}
|
271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXLessThanValidationRule, decorators: [{
|
272
272
|
type: Injectable
|
273
273
|
}] });
|
274
274
|
|
@@ -328,10 +328,10 @@ class AXValidationRegistryService {
|
|
328
328
|
get(ruleName) {
|
329
329
|
return this.plugins.find((c) => c.name == ruleName);
|
330
330
|
}
|
331
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
332
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
331
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
332
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationRegistryService, providedIn: 'root' }); }
|
333
333
|
}
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationRegistryService, decorators: [{
|
335
335
|
type: Injectable,
|
336
336
|
args: [{
|
337
337
|
providedIn: 'root',
|
@@ -366,10 +366,10 @@ class AXValidationService {
|
|
366
366
|
ruleFor(value) {
|
367
367
|
return new AXValidationRuleChain(this, value);
|
368
368
|
}
|
369
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
370
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
369
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationService, deps: [{ token: AXValidationRegistryService }, { token: i1.AXTranslationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
370
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationService, providedIn: 'root' }); }
|
371
371
|
}
|
372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationService, decorators: [{
|
373
373
|
type: Injectable,
|
374
374
|
args: [{ providedIn: 'root' }]
|
375
375
|
}], ctorParameters: () => [{ type: AXValidationRegistryService }, { type: i1.AXTranslationService }] });
|
@@ -452,11 +452,11 @@ class AXValidationModule {
|
|
452
452
|
f();
|
453
453
|
});
|
454
454
|
}
|
455
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
456
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
457
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
455
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationModule, deps: [{ token: 'AXValidationModuleFactory' }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
456
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: AXValidationModule }); }
|
457
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationModule, providers: [...BUILT_IN_RULES] }); }
|
458
458
|
}
|
459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AXValidationModule, decorators: [{
|
460
460
|
type: NgModule,
|
461
461
|
args: [{
|
462
462
|
imports: [],
|
@@ -8,6 +8,12 @@ export declare class AXFormatterRegistryService {
|
|
8
8
|
constructor(injector: Injector);
|
9
9
|
register(...plugins: (new () => AXFormatter)[]): void;
|
10
10
|
get formatters(): AXFormatter[];
|
11
|
+
/**
|
12
|
+
* Resolves a formatter by its name.
|
13
|
+
* @param name The name of the formatter.
|
14
|
+
* @returns The formatter if found, otherwise throws an error.
|
15
|
+
*/
|
16
|
+
get(name: string): AXFormatter;
|
11
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatterRegistryService, never>;
|
12
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFormatterRegistryService>;
|
13
19
|
}
|
@@ -17,12 +23,6 @@ export declare class AXFormatService {
|
|
17
23
|
private renderSubject;
|
18
24
|
onRender: import("rxjs").Observable<void>;
|
19
25
|
render(): void;
|
20
|
-
/**
|
21
|
-
* Resolves a formatter by its name.
|
22
|
-
* @param name The name of the formatter.
|
23
|
-
* @returns The formatter if found, otherwise throws an error.
|
24
|
-
*/
|
25
|
-
resolveFormatter(name: string): AXFormatter;
|
26
26
|
format<K extends keyof AXFormatOptionsMap>(value: unknown, formatter: K, options?: AXFormatOptionsMap[K]): string;
|
27
27
|
format(value: unknown): AXFormatFluent;
|
28
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatService, never>;
|
@@ -30,8 +30,9 @@ export declare class AXFormatService {
|
|
30
30
|
}
|
31
31
|
declare class AXFormatFluent {
|
32
32
|
private formatService;
|
33
|
+
private pluginRegistry;
|
33
34
|
private initialValue;
|
34
|
-
constructor(formatService: AXFormatService, initialValue: unknown);
|
35
|
+
constructor(formatService: AXFormatService, pluginRegistry: AXFormatterRegistryService, initialValue: unknown);
|
35
36
|
/**
|
36
37
|
* Formats the value using the specified formatter and options.
|
37
38
|
* @param formatter The name of the formatter to use.
|
package/package.json
CHANGED
package/translation/index.d.ts
CHANGED
@@ -2,7 +2,7 @@ export * from './lib/translation-scope.resolver';
|
|
2
2
|
export * from './lib/translation.config';
|
3
3
|
export * from './lib/translation.loader';
|
4
4
|
export * from './lib/translation.module';
|
5
|
-
export * from './lib/translation.service';
|
6
5
|
export * from './lib/translation.types';
|
7
6
|
export * from './lib/translator.directive';
|
8
7
|
export * from './lib/translator.pipe';
|
8
|
+
export * from './lib/translation.service';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Observable } from "rxjs";
|
2
|
+
import { AXTranslation, AXTranslateLang, AXTranslateScope } from "./translation.types";
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class AXTranslationLoaderService {
|
5
|
+
private loader;
|
6
|
+
private config;
|
7
|
+
private cache;
|
8
|
+
private inflight;
|
9
|
+
load(lang: AXTranslateLang, scope: AXTranslateScope): Observable<AXTranslation>;
|
10
|
+
peek(lang: AXTranslateLang, scope: AXTranslateScope, key: string): string | null;
|
11
|
+
preload(options?: {
|
12
|
+
langs?: AXTranslateLang[];
|
13
|
+
scopes?: AXTranslateScope[];
|
14
|
+
}): Promise<void>;
|
15
|
+
clear(): void;
|
16
|
+
getFallbackLangs(lang: AXTranslateLang): AXTranslateLang[];
|
17
|
+
getFallbackScopes(scope: AXTranslateScope): AXTranslateScope[];
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationLoaderService, never>;
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationLoaderService>;
|
20
|
+
}
|
@@ -1,12 +1,25 @@
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
2
2
|
import { AXTranslateLang, AXTranslateScope } from './translation.types';
|
3
3
|
export interface AXTranslationConfig {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
defaults: {
|
5
|
+
lang: AXTranslateLang;
|
6
|
+
scope: AXTranslateScope;
|
7
|
+
};
|
8
|
+
preload?: {
|
9
|
+
langs: AXTranslateLang[];
|
10
|
+
scopes: AXTranslateScope[];
|
11
|
+
};
|
12
|
+
fallbacks?: {
|
13
|
+
langs?: Record<AXTranslateLang, AXTranslateLang[]>;
|
14
|
+
scopes?: Record<AXTranslateScope, AXTranslateScope[]>;
|
15
|
+
};
|
16
|
+
available?: {
|
17
|
+
langs?: AXTranslateLang[];
|
18
|
+
scopes?: AXTranslateScope[];
|
19
|
+
};
|
20
|
+
resolver?: {
|
21
|
+
scopeKey: string;
|
22
|
+
};
|
10
23
|
}
|
11
24
|
export declare const AX_TRANSLATION_CONFIG: InjectionToken<AXTranslationConfig>;
|
12
25
|
export declare const AXTranslationDefaultConfig: AXTranslationConfig;
|
@@ -6,9 +6,9 @@ export interface AXTranslationLoaderOptions {
|
|
6
6
|
scope?: AXTranslateScope;
|
7
7
|
}
|
8
8
|
export interface AXTranslationLoader {
|
9
|
-
|
9
|
+
load(options: AXTranslationLoaderOptions): Observable<AXTranslation>;
|
10
10
|
}
|
11
11
|
export declare class AXTranslationLoaderDefault implements AXTranslationLoader {
|
12
|
-
|
12
|
+
load(options: AXTranslationLoaderOptions): Observable<AXTranslation>;
|
13
13
|
}
|
14
14
|
export declare const AX_TRANSLATION_LOADER: InjectionToken<AXTranslationLoader>;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { AXParsedToken } from "./translation.types";
|
2
|
+
export declare class TranslationParserService {
|
3
|
+
private readonly legacyRegex;
|
4
|
+
private readonly inlineRegex;
|
5
|
+
isExpression(value: string): boolean;
|
6
|
+
parse(expression: string, currentLang: string, currentScope: string): AXParsedToken[];
|
7
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { AXTranslateLang, AXTranslateScope, AXTranslateParams } from './translation.types';
|
2
|
+
export declare class TranslationResolverService {
|
3
|
+
private loaderService;
|
4
|
+
private cache;
|
5
|
+
private inflight;
|
6
|
+
private parser;
|
7
|
+
resolve(lang: AXTranslateLang, scope: AXTranslateScope, key: string, params?: AXTranslateParams): Promise<string>;
|
8
|
+
format(text: string, params?: AXTranslateParams): string;
|
9
|
+
}
|
@@ -1,44 +1,24 @@
|
|
1
|
+
import { AXTranslateLang, AXTranslateOptions } from './translation.types';
|
1
2
|
import { Observable } from 'rxjs';
|
2
|
-
import { AXTranslateOptions } from './translation.types';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
export declare function translateSync(key: string, options?: AXTranslateOptions): string;
|
5
5
|
export declare class AXTranslationService {
|
6
|
-
private loader;
|
7
|
-
private config;
|
8
|
-
private eventService;
|
9
6
|
private localeService;
|
10
|
-
private
|
11
|
-
private
|
7
|
+
private config;
|
8
|
+
private loader;
|
9
|
+
private parser;
|
10
|
+
private resolver;
|
12
11
|
private activeLang;
|
13
|
-
langChanges$: Observable<string>;
|
14
|
-
private expressionCache;
|
15
|
-
getDefaultLang(): string;
|
16
|
-
getActiveLang(): string;
|
17
|
-
setActiveLang(lang: string): void;
|
18
|
-
/**
|
19
|
-
* @ignore
|
20
|
-
*/
|
12
|
+
readonly langChanges$: Observable<string>;
|
21
13
|
constructor();
|
22
|
-
|
23
|
-
|
24
|
-
/**
|
25
|
-
* Set translation data into cache
|
26
|
-
*/
|
27
|
-
private setTranslationCache;
|
28
|
-
/**
|
29
|
-
* Get the translation from the cache or fallback to loading
|
30
|
-
*/
|
31
|
-
private getTranslationFromCache;
|
32
|
-
isLangAvailable(lang: string, scope?: string): boolean;
|
33
|
-
private translateKey;
|
34
|
-
private isExpression;
|
35
|
-
private decodeExpression;
|
36
|
-
private handleError;
|
37
|
-
private translateText;
|
14
|
+
setActiveLang(lang: AXTranslateLang): void;
|
15
|
+
getActiveLang(): AXTranslateLang;
|
38
16
|
translate$(text: string, options?: AXTranslateOptions): Observable<string>;
|
39
17
|
translateAsync(text: string, options?: AXTranslateOptions): Promise<string>;
|
40
|
-
translateSync(text: string, options?: AXTranslateOptions
|
41
|
-
|
18
|
+
translateSync(text: string, options?: AXTranslateOptions & {
|
19
|
+
waitForLoad?: boolean;
|
20
|
+
timeoutMs?: number;
|
21
|
+
}): string;
|
42
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationService, never>;
|
43
23
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationService>;
|
44
24
|
}
|
@@ -1,10 +1,16 @@
|
|
1
|
-
export type AXTranslateParams<T = unknown> = Record<string, T>;
|
2
1
|
export type AXTranslateHashMap<T = unknown> = Record<string, T>;
|
3
|
-
export type AXTranslation = Record<string, string>;
|
4
2
|
export type AXTranslateLang = string;
|
5
3
|
export type AXTranslateScope = string;
|
4
|
+
export type AXTranslateParams<T = unknown> = Record<string, T>;
|
5
|
+
export type AXTranslation = Record<string, string>;
|
6
6
|
export interface AXTranslateOptions {
|
7
7
|
lang?: AXTranslateLang;
|
8
8
|
scope?: AXTranslateScope;
|
9
9
|
params?: AXTranslateParams;
|
10
10
|
}
|
11
|
+
export interface AXParsedToken {
|
12
|
+
key: string;
|
13
|
+
scope?: AXTranslateScope;
|
14
|
+
lang?: AXTranslateLang;
|
15
|
+
fullMatch: string;
|
16
|
+
}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
2
2
|
import { Observable } from 'rxjs';
|
3
|
-
import { AXTranslationService } from './translation.service';
|
4
3
|
import { AXTranslateOptions } from './translation.types';
|
5
4
|
import * as i0 from "@angular/core";
|
6
5
|
export declare class AXTranslatorPipe implements PipeTransform {
|
7
6
|
private service;
|
8
|
-
constructor(service: AXTranslationService);
|
9
7
|
transform(key: string, options?: AXTranslateOptions): Observable<string>;
|
10
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslatorPipe, never>;
|
11
9
|
static ɵpipe: i0.ɵɵPipeDeclaration<AXTranslatorPipe, "translate", true>;
|
package/utils/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
export * from './lib/
|
2
|
-
export * from './lib/color
|
3
|
-
export * from './lib/drawing
|
4
|
-
export * from './lib/html-
|
5
|
-
export * from './lib/string
|
1
|
+
export * from './lib/lifecycle-helpers.utils';
|
2
|
+
export * from './lib/color.utils';
|
3
|
+
export * from './lib/drawing.utils';
|
4
|
+
export * from './lib/html-utils';
|
5
|
+
export * from './lib/string.utils';
|
6
|
+
export * from './lib/execution.utils';
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* Blocks until a condition returns a value or the timeout is reached.
|
3
|
+
* Useful for simulating sync behavior with cached async results.
|
4
|
+
*/
|
5
|
+
export declare function waitFor<T>(peekFn: () => T | null | undefined, loadFn: () => void, timeoutMs?: number): T | null;
|
6
|
+
/**
|
7
|
+
* Delays for a specific amount of time.
|
8
|
+
*/
|
9
|
+
export declare function delay(ms: number): Promise<void>;
|
10
|
+
/**
|
11
|
+
* Retries an async function until it succeeds or a max attempt count is reached.
|
12
|
+
*/
|
13
|
+
export declare function retryUntil<T>(fn: () => Promise<T>, attempts?: number, delayMs?: number): Promise<T>;
|
14
|
+
/**
|
15
|
+
* Continuously polls a condition until it returns true or a timeout is reached.
|
16
|
+
*/
|
17
|
+
export declare function pollUntil(condition: () => boolean, intervalMs?: number, timeoutMs?: number): Promise<boolean>;
|
18
|
+
/**
|
19
|
+
* Throttles an async function to ensure only one instance runs at a time.
|
20
|
+
*/
|
21
|
+
export declare function throttleAsync<T extends (...args: any[]) => Promise<any>>(fn: T): T;
|
22
|
+
/**
|
23
|
+
* Polls a condition with cancel support via AbortSignal.
|
24
|
+
*/
|
25
|
+
export declare function pollUntilAbortable(condition: () => boolean, intervalMs?: number, timeoutMs?: number, signal?: AbortSignal): Promise<boolean>;
|
26
|
+
/**
|
27
|
+
* Debounces an async function to run only after no calls are made within the wait window.
|
28
|
+
*/
|
29
|
+
export declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T, waitMs: number): T;
|
30
|
+
/**
|
31
|
+
* Runs a list of fallback functions until one resolves without throwing.
|
32
|
+
*/
|
33
|
+
export declare function fallbackChain<T>(tasks: Array<() => Promise<T>>): Promise<T>;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|