@flusys/ng-localization 9.1.0-rc.1 → 9.1.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/flusys-ng-localization-language-form.page-BdxZ6meb.mjs +639 -0
- package/fesm2022/flusys-ng-localization-language-form.page-BdxZ6meb.mjs.map +1 -0
- package/fesm2022/flusys-ng-localization-language-list.page-B8wnYNNd.mjs +660 -0
- package/fesm2022/flusys-ng-localization-language-list.page-B8wnYNNd.mjs.map +1 -0
- package/fesm2022/flusys-ng-localization-localization-container.page-CsrYVvth.mjs +168 -0
- package/fesm2022/flusys-ng-localization-localization-container.page-CsrYVvth.mjs.map +1 -0
- package/fesm2022/flusys-ng-localization-translation-key-form.page-Dgn58Sh7.mjs +865 -0
- package/fesm2022/flusys-ng-localization-translation-key-form.page-Dgn58Sh7.mjs.map +1 -0
- package/fesm2022/flusys-ng-localization-translation-key-list.page-DhRI5UvT.mjs +738 -0
- package/fesm2022/flusys-ng-localization-translation-key-list.page-DhRI5UvT.mjs.map +1 -0
- package/fesm2022/flusys-ng-localization.mjs +715 -2706
- package/fesm2022/flusys-ng-localization.mjs.map +1 -1
- package/package.json +5 -5
- package/types/flusys-ng-localization.d.ts +200 -399
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, computed, inject } from "@angular/core";
|
|
3
|
+
import { IconComponent, LANGUAGE_PERMISSIONS, PermissionValidatorService, TRANSLATION_KEY_PERMISSIONS, TranslatePipe } from "@flusys/ng-shared";
|
|
4
|
+
import { RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router";
|
|
5
|
+
var LocalizationContainerPage = class LocalizationContainerPage {
|
|
6
|
+
permissionValidator = inject(PermissionValidatorService);
|
|
7
|
+
allTabs = [{
|
|
8
|
+
id: "languages",
|
|
9
|
+
labelKey: "localization.tabs.languages",
|
|
10
|
+
icon: "globe",
|
|
11
|
+
route: "languages",
|
|
12
|
+
permission: LANGUAGE_PERMISSIONS.READ
|
|
13
|
+
}, {
|
|
14
|
+
id: "keys",
|
|
15
|
+
labelKey: "localization.tabs.keys",
|
|
16
|
+
icon: "key",
|
|
17
|
+
route: "keys",
|
|
18
|
+
permission: TRANSLATION_KEY_PERMISSIONS.READ
|
|
19
|
+
}];
|
|
20
|
+
visibleTabs = computed(() => {
|
|
21
|
+
if (!this.permissionValidator.permissions().length) return [];
|
|
22
|
+
return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));
|
|
23
|
+
}, ...ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []);
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.1",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: LocalizationContainerPage,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
31
|
+
});
|
|
32
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
33
|
+
minVersion: "17.0.0",
|
|
34
|
+
version: "22.2.1",
|
|
35
|
+
type: LocalizationContainerPage,
|
|
36
|
+
isStandalone: true,
|
|
37
|
+
selector: "lib-localization-container",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
template: `
|
|
40
|
+
<div class="p-2 sm:p-4">
|
|
41
|
+
<div class="mb-4">
|
|
42
|
+
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
43
|
+
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'localization.subtitle' | translate }}</p>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap">
|
|
47
|
+
@for (tab of visibleTabs(); track tab.id) {
|
|
48
|
+
<a
|
|
49
|
+
[routerLink]="tab.route"
|
|
50
|
+
routerLinkActive="tab-active"
|
|
51
|
+
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0"
|
|
52
|
+
>
|
|
53
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
54
|
+
<span>{{ tab.labelKey | translate }}</span>
|
|
55
|
+
</a>
|
|
56
|
+
}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<router-outlet />
|
|
60
|
+
</div>
|
|
61
|
+
`,
|
|
62
|
+
isInline: true,
|
|
63
|
+
styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"],
|
|
64
|
+
dependencies: [
|
|
65
|
+
{
|
|
66
|
+
kind: "directive",
|
|
67
|
+
type: RouterOutlet,
|
|
68
|
+
selector: "router-outlet",
|
|
69
|
+
inputs: ["name", "routerOutletData"],
|
|
70
|
+
outputs: [
|
|
71
|
+
"activate",
|
|
72
|
+
"deactivate",
|
|
73
|
+
"attach",
|
|
74
|
+
"detach"
|
|
75
|
+
],
|
|
76
|
+
exportAs: ["outlet"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
kind: "directive",
|
|
80
|
+
type: RouterLink,
|
|
81
|
+
selector: "[routerLink]",
|
|
82
|
+
inputs: [
|
|
83
|
+
"target",
|
|
84
|
+
"queryParams",
|
|
85
|
+
"fragment",
|
|
86
|
+
"queryParamsHandling",
|
|
87
|
+
"state",
|
|
88
|
+
"info",
|
|
89
|
+
"relativeTo",
|
|
90
|
+
"preserveFragment",
|
|
91
|
+
"skipLocationChange",
|
|
92
|
+
"replaceUrl",
|
|
93
|
+
"browserUrl",
|
|
94
|
+
"routerLink"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
kind: "directive",
|
|
99
|
+
type: RouterLinkActive,
|
|
100
|
+
selector: "[routerLinkActive]",
|
|
101
|
+
inputs: [
|
|
102
|
+
"routerLinkActiveOptions",
|
|
103
|
+
"ariaCurrentWhenActive",
|
|
104
|
+
"routerLinkActive"
|
|
105
|
+
],
|
|
106
|
+
outputs: ["isActiveChange"],
|
|
107
|
+
exportAs: ["routerLinkActive"]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
kind: "component",
|
|
111
|
+
type: IconComponent,
|
|
112
|
+
selector: "lib-icon",
|
|
113
|
+
inputs: ["icon", "iconType"]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
kind: "pipe",
|
|
117
|
+
type: TranslatePipe,
|
|
118
|
+
name: "translate"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
124
|
+
minVersion: "12.0.0",
|
|
125
|
+
version: "22.2.1",
|
|
126
|
+
ngImport: i0,
|
|
127
|
+
type: LocalizationContainerPage,
|
|
128
|
+
decorators: [{
|
|
129
|
+
type: Component,
|
|
130
|
+
args: [{
|
|
131
|
+
selector: "lib-localization-container",
|
|
132
|
+
imports: [
|
|
133
|
+
RouterOutlet,
|
|
134
|
+
RouterLink,
|
|
135
|
+
RouterLinkActive,
|
|
136
|
+
TranslatePipe,
|
|
137
|
+
IconComponent
|
|
138
|
+
],
|
|
139
|
+
template: `
|
|
140
|
+
<div class="p-2 sm:p-4">
|
|
141
|
+
<div class="mb-4">
|
|
142
|
+
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
143
|
+
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'localization.subtitle' | translate }}</p>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div class="scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap">
|
|
147
|
+
@for (tab of visibleTabs(); track tab.id) {
|
|
148
|
+
<a
|
|
149
|
+
[routerLink]="tab.route"
|
|
150
|
+
routerLinkActive="tab-active"
|
|
151
|
+
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0"
|
|
152
|
+
>
|
|
153
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
154
|
+
<span>{{ tab.labelKey | translate }}</span>
|
|
155
|
+
</a>
|
|
156
|
+
}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<router-outlet />
|
|
160
|
+
</div>
|
|
161
|
+
`,
|
|
162
|
+
styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"]
|
|
163
|
+
}]
|
|
164
|
+
}]
|
|
165
|
+
});
|
|
166
|
+
export { LocalizationContainerPage };
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=flusys-ng-localization-localization-container.page-CsrYVvth.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-localization-localization-container.page-CsrYVvth.mjs","names":[],"sources":["../../../projects/ng-localization/pages/localization-container/localization-container.page.ts"],"sourcesContent":["import { Component, computed, inject } from '@angular/core';\nimport { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';\nimport {\n IconComponent,\n LANGUAGE_PERMISSIONS,\n PermissionValidatorService,\n TRANSLATION_KEY_PERMISSIONS,\n TranslatePipe,\n} from '@flusys/ng-shared';\n\ninterface ITab {\n id: string;\n labelKey: string;\n icon: string;\n route: string;\n permission: string;\n}\n\n@Component({\n selector: 'lib-localization-container',\n imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe, IconComponent],\n styles: `\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar { display: none; }\n }\n `,\n template: `\n <div class=\"p-2 sm:p-4\">\n <div class=\"mb-4\">\n <h1 class=\"text-xl sm:text-2xl font-bold m-0\">{{ 'localization.title' | translate }}</h1>\n <p class=\"text-muted-color mt-1 text-sm sm:text-base\">{{ 'localization.subtitle' | translate }}</p>\n </div>\n\n <div class=\"scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap\">\n @for (tab of visibleTabs(); track tab.id) {\n <a\n [routerLink]=\"tab.route\"\n routerLinkActive=\"tab-active\"\n class=\"flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0\"\n >\n <lib-icon [icon]=\"tab.icon\"></lib-icon>\n <span>{{ tab.labelKey | translate }}</span>\n </a>\n }\n </div>\n\n <router-outlet />\n </div>\n `,\n})\nexport class LocalizationContainerPage {\n private readonly permissionValidator = inject(PermissionValidatorService);\n\n private readonly allTabs: ITab[] = [\n {\n id: 'languages',\n labelKey: 'localization.tabs.languages',\n icon: 'globe',\n route: 'languages',\n permission: LANGUAGE_PERMISSIONS.READ,\n },\n {\n id: 'keys',\n labelKey: 'localization.tabs.keys',\n icon: 'key',\n route: 'keys',\n permission: TRANSLATION_KEY_PERMISSIONS.READ,\n },\n ];\n\n readonly visibleTabs = computed(() => {\n // Explicitly track permissions signal for reactivity\n const permissions = this.permissionValidator.permissions();\n if (!permissions.length) return [];\n return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));\n });\n}\n"],"mappings":";;;;AAoDA,IAAa,4BAAb,MAAa,0BAAyB;CACnB,sBAAsB,OAAO,0BAA0B;CAEvD,UAAkB,CACjC;EACE,IAAI;EACJ,UAAU;EACV,MAAM;EACN,OAAO;EACP,YAAY,qBAAqB;CAClC,GACD;EACE,IAAI;EACJ,UAAU;EACV,MAAM;EACN,OAAO;EACP,YAAY,4BAA4B;CACzC,C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