@o3r/localization 15.3.0-prerelease.15 → 15.3.0-prerelease.18
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/o3r-localization-rules-engine.mjs +89 -56
- package/fesm2022/o3r-localization-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-localization.mjs +1219 -1162
- package/fesm2022/o3r-localization.mjs.map +1 -1
- package/package.json +7 -7
- package/types/o3r-localization-rules-engine.d.ts +21 -27
- package/types/o3r-localization-rules-engine.d.ts.map +1 -1
- package/types/o3r-localization.d.ts +637 -664
- package/types/o3r-localization.d.ts.map +1 -1
|
@@ -1,57 +1,90 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { Store } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
i0.ɵɵ
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable, NgModule, inject } from "@angular/core";
|
|
3
|
+
import { Store } from "@ngrx/store";
|
|
4
|
+
import { LocalizationOverrideStoreModule, setLocalizationOverride } from "@o3r/localization";
|
|
5
|
+
const RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE = "UPDATE_LOCALISATION";
|
|
6
|
+
var LocalizationRulesEngineActionHandler = class LocalizationRulesEngineActionHandler {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.store = inject(Store);
|
|
9
|
+
this.supportingActions = [RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE];
|
|
10
|
+
}
|
|
11
|
+
executeActions(actions) {
|
|
12
|
+
const localizationOverrides = actions.reduce((acc, { key, value }) => {
|
|
13
|
+
acc[key] = value;
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
this.store.dispatch(setLocalizationOverride({ state: { localizationOverrides } }));
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
20
|
+
minVersion: "12.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: LocalizationRulesEngineActionHandler,
|
|
24
|
+
deps: [],
|
|
25
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: LocalizationRulesEngineActionHandler
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
38
|
+
minVersion: "12.0.0",
|
|
39
|
+
version: "22.2.3",
|
|
40
|
+
ngImport: i0,
|
|
41
|
+
type: LocalizationRulesEngineActionHandler,
|
|
42
|
+
decorators: [{ type: Injectable }]
|
|
43
|
+
});
|
|
44
|
+
var LocalizationRulesEngineActionModule = class LocalizationRulesEngineActionModule {
|
|
45
|
+
static {
|
|
46
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
47
|
+
minVersion: "12.0.0",
|
|
48
|
+
version: "22.2.3",
|
|
49
|
+
ngImport: i0,
|
|
50
|
+
type: LocalizationRulesEngineActionModule,
|
|
51
|
+
deps: [],
|
|
52
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
static {
|
|
56
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
57
|
+
minVersion: "14.0.0",
|
|
58
|
+
version: "22.2.3",
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
type: LocalizationRulesEngineActionModule,
|
|
61
|
+
imports: [LocalizationOverrideStoreModule]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static {
|
|
65
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
66
|
+
minVersion: "12.0.0",
|
|
67
|
+
version: "22.2.3",
|
|
68
|
+
ngImport: i0,
|
|
69
|
+
type: LocalizationRulesEngineActionModule,
|
|
70
|
+
providers: [LocalizationRulesEngineActionHandler],
|
|
71
|
+
imports: [LocalizationOverrideStoreModule]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
76
|
+
minVersion: "12.0.0",
|
|
77
|
+
version: "22.2.3",
|
|
78
|
+
ngImport: i0,
|
|
79
|
+
type: LocalizationRulesEngineActionModule,
|
|
80
|
+
decorators: [{
|
|
81
|
+
type: NgModule,
|
|
82
|
+
args: [{
|
|
83
|
+
imports: [LocalizationOverrideStoreModule],
|
|
84
|
+
providers: [LocalizationRulesEngineActionHandler]
|
|
85
|
+
}]
|
|
86
|
+
}]
|
|
87
|
+
});
|
|
56
88
|
export { LocalizationRulesEngineActionHandler, LocalizationRulesEngineActionModule, RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE };
|
|
57
|
-
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=o3r-localization-rules-engine.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-localization-rules-engine.mjs","sources":["../../src/rules-engine/localization-interfaces.ts","../../src/rules-engine/localization-rules-engine-action-handler.ts","../../src/rules-engine/localization-rules-engine-module.ts"
|
|
1
|
+
{"version":3,"file":"o3r-localization-rules-engine.mjs","names":[],"sources":["../../src/rules-engine/localization-interfaces.ts","../../src/rules-engine/localization-rules-engine-action-handler.ts","../../src/rules-engine/localization-rules-engine-module.ts"],"sourcesContent":["import type {\n RulesEngineAction,\n} from '@o3r/core';\n\n/** ActionUpdateLocalisationBlock */\nexport const RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE = 'UPDATE_LOCALISATION';\n\n/**\n * Content of action that updates localization\n */\nexport interface ActionUpdateLocalisationBlock extends RulesEngineAction {\n actionType: typeof RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE;\n key: string;\n value: string;\n}\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n Store,\n} from '@ngrx/store';\nimport type {\n RulesEngineActionHandler,\n} from '@o3r/core';\nimport {\n ActionUpdateLocalisationBlock,\n RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE,\n} from './localization-interfaces';\nimport {\n LocalizationOverrideStore,\n setLocalizationOverride,\n} from '@o3r/localization';\n\n/**\n * Service to handle async Localization actions\n */\n@Injectable()\nexport class LocalizationRulesEngineActionHandler implements RulesEngineActionHandler<ActionUpdateLocalisationBlock> {\n private readonly store = inject<Store<LocalizationOverrideStore>>(Store);\n\n /** @inheritdoc */\n public readonly supportingActions = [RULES_ENGINE_LOCALISATION_UPDATE_ACTION_TYPE] as const;\n\n /** @inheritdoc */\n public executeActions(actions: ActionUpdateLocalisationBlock[]): void | Promise<void> {\n const localizationOverrides = actions.reduce<Record<string, string>>((acc, { key, value }) => {\n acc[key] = value;\n return acc;\n }, {});\n\n this.store.dispatch(setLocalizationOverride({ state: { localizationOverrides } }));\n }\n}\n","import {\n NgModule,\n} from '@angular/core';\nimport {\n LocalizationRulesEngineActionHandler,\n} from './localization-rules-engine-action-handler';\nimport {\n LocalizationOverrideStoreModule,\n} from '@o3r/localization';\n\n@NgModule({\n imports: [\n LocalizationOverrideStoreModule\n ],\n providers: [\n LocalizationRulesEngineActionHandler\n ]\n})\nexport class LocalizationRulesEngineActionModule {}\n"],"mappings":";;;;AAKA,MAAa,+CAA+C;ACkB5D,IAAa,uCAAb,MAAa,qCAAoC;CADjD,cAAA;EAEmB,KAAA,QAAQ,OAAyC,KAAK;EAGvD,KAAA,oBAAoB,CAAC,4CAA4C;CAWlF;CARQ,eAAe,SAAwC;EAC5D,MAAM,wBAAwB,QAAQ,QAAgC,KAAK,EAAE,KAAK,YAAW;GAC3F,IAAI,OAAO;GACX,OAAO;EACT,GAAG,CAAA,CAAE;EAEL,KAAK,MAAM,SAAS,wBAAwB,EAAE,OAAO,EAAE,sBAAqB,EAAE,CAAE,CAAC;CACnF;CAdW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAoC,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAApC;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAoC,CAAA;CAAA;;AAApC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoC,YAAA,CAAA,EADhD,MAAA,W;;ACJD,IAAa,sCAAb,MAAa,oCAAmC;CAAnC;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmC,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAnC;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmC,SAAA,CAN5C,+BAA+B;EAAA,CAAA;CAAA;CAMtB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmC,WAJnC,CACT,oCACD;GAAA,SAAA,CAJC,+BAA+B;EAAA,CAAA;CAAA;;AAMtB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmC,YAAA,CAAA;EAR/C,MAAA;EAAS,MAAA,CAAA;GACR,SAAS,CACP,+BACD;GACD,WAAW,CACT,oCACD;EACF,CAAA"}
|