@flusys/ng-localization 5.5.0 → 6.0.0-beta.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.
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, inject, ApplicationRef, signal, computed, effect, DestroyRef,
|
|
3
|
-
import { ApiResourceService, PlatformService, TranslateService, AngularModule,
|
|
2
|
+
import { InjectionToken, Injectable, inject, ApplicationRef, signal, computed, effect, DestroyRef, Component, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { ApiResourceService, PlatformService, TranslateService, AngularModule, TranslatePipe, LANGUAGE_PERMISSIONS, HasPermissionDirective, PermissionValidatorService, TRANSLATION_KEY_PERMISSIONS, IconComponent, resolveTranslationModule, SHARED_MESSAGES } from '@flusys/ng-shared';
|
|
4
4
|
import { HttpClient } from '@angular/common/http';
|
|
5
5
|
import { APP_CONFIG, LOCALIZATION_API_SERVICE, LOCALIZATION_STATE_SERVICE } from '@flusys/ng-core';
|
|
6
|
-
import { firstValueFrom, from,
|
|
6
|
+
import { firstValueFrom, from, finalize, forkJoin } from 'rxjs';
|
|
7
7
|
import { DOCUMENT } from '@angular/common';
|
|
8
|
-
import
|
|
8
|
+
import * as i1 from '@flusys/ng-ui';
|
|
9
|
+
import { UiModule, MenuComponent, MessageService, ConfirmationService } from '@flusys/ng-ui';
|
|
9
10
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
10
|
-
import * as i1 from 'primeng/styleclass';
|
|
11
|
-
import { StyleClassModule } from 'primeng/styleclass';
|
|
12
|
-
import { filter } from 'rxjs/operators';
|
|
13
11
|
import { LAYOUT_LANGUAGE_SELECTOR, LAYOUT_LANGUAGE_SELECTOR_PANEL } from '@flusys/ng-layout';
|
|
14
|
-
import * as
|
|
12
|
+
import * as i2 from '@angular/forms';
|
|
15
13
|
import { FormsModule } from '@angular/forms';
|
|
16
14
|
import { form, required, maxLength, FormField } from '@angular/forms/signals';
|
|
17
15
|
import { Router, ActivatedRoute, RouterOutlet, RouterLink, RouterLinkActive } from '@angular/router';
|
|
18
|
-
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
19
|
-
import * as i2 from 'primeng/button';
|
|
20
|
-
import * as i3 from 'primeng/card';
|
|
21
|
-
import * as i4 from 'primeng/inputtext';
|
|
22
|
-
import * as i5 from 'primeng/select';
|
|
23
|
-
import * as i2$1 from 'primeng/table';
|
|
24
|
-
import * as i3$1 from 'primeng/tag';
|
|
25
|
-
import * as i4$1 from 'primeng/tooltip';
|
|
26
|
-
import * as i7 from 'primeng/textarea';
|
|
27
|
-
import * as i8 from 'primeng/progressspinner';
|
|
28
|
-
import * as i3$2 from 'primeng/iconfield';
|
|
29
|
-
import * as i4$2 from 'primeng/inputicon';
|
|
30
16
|
|
|
31
17
|
const LOCALIZATION_CONFIG = new InjectionToken('LOCALIZATION_CONFIG');
|
|
32
18
|
/** Get localization config with sensible defaults applied */
|
|
@@ -160,10 +146,10 @@ class LanguageApiService extends ApiResourceService {
|
|
|
160
146
|
setDefault(id) {
|
|
161
147
|
return this.http.post(`${this.baseUrl}/set-default`, { id });
|
|
162
148
|
}
|
|
163
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
164
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
150
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageApiService, providedIn: 'root' });
|
|
165
151
|
}
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageApiService, decorators: [{
|
|
167
153
|
type: Injectable,
|
|
168
154
|
args: [{ providedIn: 'root' }]
|
|
169
155
|
}], ctorParameters: () => [] });
|
|
@@ -180,10 +166,10 @@ class LocalizationApiService {
|
|
|
180
166
|
getTranslationsByLanguage(languageCode, modules) {
|
|
181
167
|
return this.http.post(`${this.baseUrl}/translation/get-by-language`, { languageCode, ...(modules?.length ? { modules } : {}) });
|
|
182
168
|
}
|
|
183
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
184
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
169
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
170
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationApiService, providedIn: 'root' });
|
|
185
171
|
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationApiService, decorators: [{
|
|
187
173
|
type: Injectable,
|
|
188
174
|
args: [{ providedIn: 'root' }]
|
|
189
175
|
}] });
|
|
@@ -224,10 +210,10 @@ class LocalizationInitializerService {
|
|
|
224
210
|
this.stateService.setLoading(false);
|
|
225
211
|
}
|
|
226
212
|
}
|
|
227
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
228
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationInitializerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
214
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationInitializerService, providedIn: 'root' });
|
|
229
215
|
}
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationInitializerService, decorators: [{
|
|
231
217
|
type: Injectable,
|
|
232
218
|
args: [{ providedIn: 'root' }]
|
|
233
219
|
}] });
|
|
@@ -236,7 +222,6 @@ class LocalizationStateService {
|
|
|
236
222
|
platformService = inject(PlatformService);
|
|
237
223
|
document = inject(DOCUMENT);
|
|
238
224
|
appRef = inject(ApplicationRef);
|
|
239
|
-
primeNG = inject(PrimeNG);
|
|
240
225
|
_loadedModules = new Set();
|
|
241
226
|
_currentLanguage = signal(null, /* @ts-ignore */
|
|
242
227
|
...(ngDevMode ? [{ debugName: "_currentLanguage" }] : /* istanbul ignore next */ []));
|
|
@@ -263,86 +248,10 @@ class LocalizationStateService {
|
|
|
263
248
|
localStorage.setItem(STORAGE_KEYS.CURRENT_LANGUAGE, language.code);
|
|
264
249
|
}
|
|
265
250
|
});
|
|
266
|
-
// Trigger zoneless change detection when translations update
|
|
267
251
|
effect(() => {
|
|
268
252
|
this._translations();
|
|
269
253
|
setTimeout(() => this.appRef.tick(), 0);
|
|
270
254
|
});
|
|
271
|
-
effect(() => {
|
|
272
|
-
const translations = this._translations();
|
|
273
|
-
const fallbacks = this._fallbackMessages();
|
|
274
|
-
this.syncPrimeNGTranslations(translations, fallbacks);
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
dotToCamel(str) {
|
|
278
|
-
return str.replace(/\.([a-z])/g, (_, c) => c.toUpperCase());
|
|
279
|
-
}
|
|
280
|
-
PRIMENG_NUMERIC_KEYS = new Set(['firstDayOfWeek']);
|
|
281
|
-
PRIMENG_ARRAY_DEFAULTS = {
|
|
282
|
-
dayNames: [
|
|
283
|
-
'Sunday',
|
|
284
|
-
'Monday',
|
|
285
|
-
'Tuesday',
|
|
286
|
-
'Wednesday',
|
|
287
|
-
'Thursday',
|
|
288
|
-
'Friday',
|
|
289
|
-
'Saturday',
|
|
290
|
-
],
|
|
291
|
-
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
292
|
-
dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
293
|
-
monthNames: [
|
|
294
|
-
'January',
|
|
295
|
-
'February',
|
|
296
|
-
'March',
|
|
297
|
-
'April',
|
|
298
|
-
'May',
|
|
299
|
-
'June',
|
|
300
|
-
'July',
|
|
301
|
-
'August',
|
|
302
|
-
'September',
|
|
303
|
-
'October',
|
|
304
|
-
'November',
|
|
305
|
-
'December',
|
|
306
|
-
],
|
|
307
|
-
monthNamesShort: [
|
|
308
|
-
'Jan',
|
|
309
|
-
'Feb',
|
|
310
|
-
'Mar',
|
|
311
|
-
'Apr',
|
|
312
|
-
'May',
|
|
313
|
-
'Jun',
|
|
314
|
-
'Jul',
|
|
315
|
-
'Aug',
|
|
316
|
-
'Sep',
|
|
317
|
-
'Oct',
|
|
318
|
-
'Nov',
|
|
319
|
-
'Dec',
|
|
320
|
-
],
|
|
321
|
-
};
|
|
322
|
-
syncPrimeNGTranslations(translations, fallbacks) {
|
|
323
|
-
const primeNGTranslations = {
|
|
324
|
-
...this.PRIMENG_ARRAY_DEFAULTS,
|
|
325
|
-
};
|
|
326
|
-
const ariaTranslations = {};
|
|
327
|
-
const prefix = 'primeng.';
|
|
328
|
-
const ariaPrefix = 'primeng.aria.';
|
|
329
|
-
const allMessages = { ...fallbacks, ...translations };
|
|
330
|
-
for (const [key, value] of Object.entries(allMessages)) {
|
|
331
|
-
if (key.startsWith(ariaPrefix)) {
|
|
332
|
-
const ariaKey = this.dotToCamel(key.substring(ariaPrefix.length));
|
|
333
|
-
ariaTranslations[ariaKey] = value;
|
|
334
|
-
}
|
|
335
|
-
else if (key.startsWith(prefix)) {
|
|
336
|
-
const primeKey = this.dotToCamel(key.substring(prefix.length));
|
|
337
|
-
primeNGTranslations[primeKey] = this.PRIMENG_NUMERIC_KEYS.has(primeKey)
|
|
338
|
-
? parseInt(value, 10)
|
|
339
|
-
: value;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
if (Object.keys(ariaTranslations).length > 0) {
|
|
343
|
-
primeNGTranslations['aria'] = ariaTranslations;
|
|
344
|
-
}
|
|
345
|
-
this.primeNG.setTranslation(primeNGTranslations);
|
|
346
255
|
}
|
|
347
256
|
setCurrentLanguage(language) {
|
|
348
257
|
this._currentLanguage.set(language);
|
|
@@ -379,10 +288,10 @@ class LocalizationStateService {
|
|
|
379
288
|
updateFallbackMessages(messages) {
|
|
380
289
|
this._fallbackMessages.update((current) => ({ ...current, ...messages }));
|
|
381
290
|
}
|
|
382
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
383
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
291
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
292
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationStateService, providedIn: 'root' });
|
|
384
293
|
}
|
|
385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationStateService, decorators: [{
|
|
386
295
|
type: Injectable,
|
|
387
296
|
args: [{ providedIn: 'root' }]
|
|
388
297
|
}], ctorParameters: () => [] });
|
|
@@ -404,10 +313,10 @@ class TranslationApiService extends ApiResourceService {
|
|
|
404
313
|
bulkUpdate(translations) {
|
|
405
314
|
return this.http.post(`${this.baseUrl}/update-many-values`, { translations });
|
|
406
315
|
}
|
|
407
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
408
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
317
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationApiService, providedIn: 'root' });
|
|
409
318
|
}
|
|
410
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationApiService, decorators: [{
|
|
411
320
|
type: Injectable,
|
|
412
321
|
args: [{ providedIn: 'root' }]
|
|
413
322
|
}], ctorParameters: () => [] });
|
|
@@ -419,10 +328,10 @@ class TranslationKeyApiService extends ApiResourceService {
|
|
|
419
328
|
getModules() {
|
|
420
329
|
return this.http.post(`${this.baseUrl}/get-modules`, {});
|
|
421
330
|
}
|
|
422
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
423
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
331
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
332
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyApiService, providedIn: 'root' });
|
|
424
333
|
}
|
|
425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyApiService, decorators: [{
|
|
426
335
|
type: Injectable,
|
|
427
336
|
args: [{ providedIn: 'root' }]
|
|
428
337
|
}], ctorParameters: () => [] });
|
|
@@ -486,10 +395,10 @@ class TranslationLoaderService {
|
|
|
486
395
|
loadTranslationsAsync(languageCode, clearModules = false) {
|
|
487
396
|
return from(this.loadTranslations(languageCode, clearModules));
|
|
488
397
|
}
|
|
489
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
490
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
398
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
399
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationLoaderService, providedIn: 'root' });
|
|
491
400
|
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationLoaderService, decorators: [{
|
|
493
402
|
type: Injectable,
|
|
494
403
|
args: [{ providedIn: 'root' }]
|
|
495
404
|
}] });
|
|
@@ -498,121 +407,59 @@ class LanguageSelectorComponent {
|
|
|
498
407
|
localizationState = inject(LocalizationStateService);
|
|
499
408
|
translationLoader = inject(TranslationLoaderService);
|
|
500
409
|
destroyRef = inject(DestroyRef);
|
|
501
|
-
document = inject(DOCUMENT);
|
|
502
|
-
elementRef = inject(ElementRef);
|
|
503
410
|
languages = this.localizationState.availableLanguages;
|
|
504
|
-
_isActive = signal(false, /* @ts-ignore */
|
|
505
|
-
...(ngDevMode ? [{ debugName: "_isActive" }] : /* istanbul ignore next */ []));
|
|
506
|
-
isActive = this._isActive.asReadonly();
|
|
507
411
|
selectedLanguageCode = this.localizationState.currentLanguageCode;
|
|
508
412
|
selectedLanguage = computed(() => this.languages().find((l) => l.code === this.selectedLanguageCode()) ?? null, /* @ts-ignore */
|
|
509
413
|
...(ngDevMode ? [{ debugName: "selectedLanguage" }] : /* istanbul ignore next */ []));
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
togglePanel() {
|
|
521
|
-
this._isActive.update((v) => !v);
|
|
522
|
-
}
|
|
414
|
+
menuItems = computed(() => this.languages().map((lang) => ({
|
|
415
|
+
label: lang.nativeName || lang.name,
|
|
416
|
+
badge: lang.code.toUpperCase(),
|
|
417
|
+
selected: lang.code === this.selectedLanguageCode(),
|
|
418
|
+
command: () => this.onLanguageSelect(lang.code),
|
|
419
|
+
})), /* @ts-ignore */
|
|
420
|
+
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
523
421
|
onLanguageSelect(code) {
|
|
524
422
|
const language = this.languages().find((l) => l.code === code);
|
|
525
423
|
if (language) {
|
|
526
424
|
this.localizationState.setCurrentLanguage(language);
|
|
527
|
-
this._isActive.set(false);
|
|
528
425
|
this.translationLoader
|
|
529
426
|
.loadTranslationsAsync(code, true)
|
|
530
427
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
531
428
|
.subscribe();
|
|
532
429
|
}
|
|
533
430
|
}
|
|
534
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
535
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
431
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
432
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: LanguageSelectorComponent, isStandalone: true, selector: "lib-language-selector", host: { classAttribute: "relative" }, ngImport: i0, template: `
|
|
536
433
|
<button
|
|
537
434
|
type="button"
|
|
538
435
|
class="layout-topbar-action"
|
|
539
|
-
[class.layout-topbar-action-highlight]="
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
enterActiveClass="animate-scalein"
|
|
543
|
-
leaveToClass="hidden"
|
|
544
|
-
leaveActiveClass="animate-fadeout"
|
|
545
|
-
[hideOnOutsideClick]="true"
|
|
546
|
-
(click)="togglePanel()">
|
|
547
|
-
<i class="pi pi-globe"></i>
|
|
436
|
+
[class.layout-topbar-action-highlight]="menu.visible()"
|
|
437
|
+
(click)="menu.toggle($event)">
|
|
438
|
+
<ui-icon name="globe"></ui-icon>
|
|
548
439
|
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
549
440
|
</button>
|
|
550
|
-
<
|
|
551
|
-
|
|
552
|
-
style="background-color: var(--surface-overlay); inset-inline-end: 0;">
|
|
553
|
-
<div class="flex flex-col">
|
|
554
|
-
@for (lang of languages(); track lang.id) {
|
|
555
|
-
<button
|
|
556
|
-
type="button"
|
|
557
|
-
class="flex items-center gap-3 px-3 py-2.5 rounded-border cursor-pointer transition-all duration-200 text-left w-full border-none bg-transparent hover:bg-emphasis"
|
|
558
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
559
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
560
|
-
(click)="onLanguageSelect(lang.code)">
|
|
561
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
562
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
563
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
564
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
565
|
-
}
|
|
566
|
-
</button>
|
|
567
|
-
}
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: StyleClassModule }, { kind: "directive", type: i1.StyleClass, selector: "[pStyleClass]", inputs: ["pStyleClass", "enterFromClass", "enterActiveClass", "enterToClass", "leaveFromClass", "leaveActiveClass", "leaveToClass", "hideOnOutsideClick", "toggleClass", "hideOnEscape", "hideOnResize", "resizeSelector"] }] });
|
|
441
|
+
<f-menu #menu [model]="menuItems()" [popup]="true" class="absolute top-[3.25rem]" style="inset-inline-end: 0;" />
|
|
442
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: UiModule }, { kind: "component", type: i1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "component", type: i1.MenuComponent, selector: "f-menu", inputs: ["model", "popup"] }] });
|
|
571
443
|
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
|
|
573
445
|
type: Component,
|
|
574
446
|
args: [{
|
|
575
447
|
selector: 'lib-language-selector',
|
|
576
|
-
imports: [
|
|
448
|
+
imports: [UiModule],
|
|
577
449
|
host: { class: 'relative' },
|
|
578
450
|
template: `
|
|
579
451
|
<button
|
|
580
452
|
type="button"
|
|
581
453
|
class="layout-topbar-action"
|
|
582
|
-
[class.layout-topbar-action-highlight]="
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
enterActiveClass="animate-scalein"
|
|
586
|
-
leaveToClass="hidden"
|
|
587
|
-
leaveActiveClass="animate-fadeout"
|
|
588
|
-
[hideOnOutsideClick]="true"
|
|
589
|
-
(click)="togglePanel()">
|
|
590
|
-
<i class="pi pi-globe"></i>
|
|
454
|
+
[class.layout-topbar-action-highlight]="menu.visible()"
|
|
455
|
+
(click)="menu.toggle($event)">
|
|
456
|
+
<ui-icon name="globe"></ui-icon>
|
|
591
457
|
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
592
458
|
</button>
|
|
593
|
-
<
|
|
594
|
-
class="hidden absolute top-[3.25rem] z-50 p-3 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)] min-w-[180px]"
|
|
595
|
-
style="background-color: var(--surface-overlay); inset-inline-end: 0;">
|
|
596
|
-
<div class="flex flex-col">
|
|
597
|
-
@for (lang of languages(); track lang.id) {
|
|
598
|
-
<button
|
|
599
|
-
type="button"
|
|
600
|
-
class="flex items-center gap-3 px-3 py-2.5 rounded-border cursor-pointer transition-all duration-200 text-left w-full border-none bg-transparent hover:bg-emphasis"
|
|
601
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
602
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
603
|
-
(click)="onLanguageSelect(lang.code)">
|
|
604
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
605
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
606
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
607
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
608
|
-
}
|
|
609
|
-
</button>
|
|
610
|
-
}
|
|
611
|
-
</div>
|
|
612
|
-
</div>
|
|
459
|
+
<f-menu #menu [model]="menuItems()" [popup]="true" class="absolute top-[3.25rem]" style="inset-inline-end: 0;" />
|
|
613
460
|
`,
|
|
614
461
|
}]
|
|
615
|
-
}]
|
|
462
|
+
}] });
|
|
616
463
|
|
|
617
464
|
class LanguageSelectorPanelComponent {
|
|
618
465
|
localizationState = inject(LocalizationStateService);
|
|
@@ -622,6 +469,13 @@ class LanguageSelectorPanelComponent {
|
|
|
622
469
|
_selectedLanguageCode = signal(this.localizationState.currentLanguageCode(), /* @ts-ignore */
|
|
623
470
|
...(ngDevMode ? [{ debugName: "_selectedLanguageCode" }] : /* istanbul ignore next */ []));
|
|
624
471
|
selectedLanguageCode = this._selectedLanguageCode.asReadonly();
|
|
472
|
+
menuItems = computed(() => this.languages().map((lang) => ({
|
|
473
|
+
label: lang.nativeName || lang.name,
|
|
474
|
+
badge: lang.code.toUpperCase(),
|
|
475
|
+
selected: lang.code === this.selectedLanguageCode(),
|
|
476
|
+
command: () => this.onLanguageSelect(lang.code),
|
|
477
|
+
})), /* @ts-ignore */
|
|
478
|
+
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
625
479
|
constructor() {
|
|
626
480
|
effect(() => {
|
|
627
481
|
const currentCode = this.localizationState.currentLanguageCode();
|
|
@@ -641,53 +495,19 @@ class LanguageSelectorPanelComponent {
|
|
|
641
495
|
.subscribe();
|
|
642
496
|
}
|
|
643
497
|
}
|
|
644
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
645
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
646
|
-
<div class="flex flex-col">
|
|
647
|
-
@for (lang of languages(); track lang.id) {
|
|
648
|
-
<button
|
|
649
|
-
type="button"
|
|
650
|
-
class="flex items-center gap-3 px-3 py-2.5 rounded-border cursor-pointer transition-all duration-200 text-left w-full border-none bg-transparent hover:bg-emphasis"
|
|
651
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
652
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
653
|
-
(click)="onLanguageSelect(lang.code)">
|
|
654
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
655
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
656
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
657
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
658
|
-
}
|
|
659
|
-
</button>
|
|
660
|
-
}
|
|
661
|
-
</div>
|
|
662
|
-
`, isInline: true });
|
|
498
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
499
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: LanguageSelectorPanelComponent, isStandalone: true, selector: "lib-language-selector-panel", host: { styleAttribute: "background-color: var(--surface-overlay); inset-inline-end: 0;", classAttribute: "hidden absolute top-[3.25rem] z-50 p-3 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)] min-w-[180px]" }, ngImport: i0, template: `<f-menu [model]="menuItems()" />`, isInline: true, dependencies: [{ kind: "component", type: MenuComponent, selector: "f-menu", inputs: ["model", "popup"] }] });
|
|
663
500
|
}
|
|
664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorPanelComponent, decorators: [{
|
|
665
502
|
type: Component,
|
|
666
503
|
args: [{
|
|
667
504
|
selector: 'lib-language-selector-panel',
|
|
668
|
-
imports: [],
|
|
505
|
+
imports: [MenuComponent],
|
|
669
506
|
host: {
|
|
670
507
|
class: 'hidden absolute top-[3.25rem] z-50 p-3 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)] min-w-[180px]',
|
|
671
508
|
style: 'background-color: var(--surface-overlay); inset-inline-end: 0;',
|
|
672
509
|
},
|
|
673
|
-
template:
|
|
674
|
-
<div class="flex flex-col">
|
|
675
|
-
@for (lang of languages(); track lang.id) {
|
|
676
|
-
<button
|
|
677
|
-
type="button"
|
|
678
|
-
class="flex items-center gap-3 px-3 py-2.5 rounded-border cursor-pointer transition-all duration-200 text-left w-full border-none bg-transparent hover:bg-emphasis"
|
|
679
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
680
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
681
|
-
(click)="onLanguageSelect(lang.code)">
|
|
682
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
683
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
684
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
685
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
686
|
-
}
|
|
687
|
-
</button>
|
|
688
|
-
}
|
|
689
|
-
</div>
|
|
690
|
-
`,
|
|
510
|
+
template: `<f-menu [model]="menuItems()" />`,
|
|
691
511
|
}]
|
|
692
512
|
}], ctorParameters: () => [] });
|
|
693
513
|
|
|
@@ -860,9 +680,9 @@ class LanguageFormPage {
|
|
|
860
680
|
onCancel() {
|
|
861
681
|
this.router.navigate(['/localization/languages']);
|
|
862
682
|
}
|
|
863
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
864
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
865
|
-
<
|
|
683
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LanguageFormPage, isStandalone: true, selector: "lib-language-form-page", providers: [MessageService], ngImport: i0, template: `
|
|
685
|
+
<f-card>
|
|
866
686
|
<ng-template #header>
|
|
867
687
|
<div class="flex justify-between items-center p-4">
|
|
868
688
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -885,7 +705,7 @@ class LanguageFormPage {
|
|
|
885
705
|
>{{ 'localization.language.code' | translate }} *</label
|
|
886
706
|
>
|
|
887
707
|
<input
|
|
888
|
-
|
|
708
|
+
fInputText
|
|
889
709
|
id="code"
|
|
890
710
|
[formField]="formTree.code"
|
|
891
711
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -901,7 +721,7 @@ class LanguageFormPage {
|
|
|
901
721
|
>{{ 'localization.language.name' | translate }} *</label
|
|
902
722
|
>
|
|
903
723
|
<input
|
|
904
|
-
|
|
724
|
+
fInputText
|
|
905
725
|
id="name"
|
|
906
726
|
[formField]="formTree.name"
|
|
907
727
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -914,7 +734,7 @@ class LanguageFormPage {
|
|
|
914
734
|
'localization.language.native.name' | translate
|
|
915
735
|
}}</label>
|
|
916
736
|
<input
|
|
917
|
-
|
|
737
|
+
fInputText
|
|
918
738
|
id="nativeName"
|
|
919
739
|
[formField]="formTree.nativeName"
|
|
920
740
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -929,7 +749,7 @@ class LanguageFormPage {
|
|
|
929
749
|
<label for="direction" class="font-medium"
|
|
930
750
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
931
751
|
>
|
|
932
|
-
<
|
|
752
|
+
<f-select
|
|
933
753
|
id="direction"
|
|
934
754
|
[ngModel]="formModel().direction"
|
|
935
755
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -947,7 +767,7 @@ class LanguageFormPage {
|
|
|
947
767
|
'localization.language.display.order' | translate
|
|
948
768
|
}}</label>
|
|
949
769
|
<input
|
|
950
|
-
|
|
770
|
+
fInputText
|
|
951
771
|
id="serial"
|
|
952
772
|
type="number"
|
|
953
773
|
[formField]="formTree.serial"
|
|
@@ -960,20 +780,14 @@ class LanguageFormPage {
|
|
|
960
780
|
|
|
961
781
|
<!-- Checkboxes -->
|
|
962
782
|
<div class="flex items-center gap-6 md:col-span-2 pt-4">
|
|
963
|
-
<
|
|
964
|
-
|
|
965
|
-
<span>{{ 'shared.active' | translate }}</span>
|
|
966
|
-
</label>
|
|
967
|
-
<label class="p-checkbox-native">
|
|
968
|
-
<input type="checkbox" [formField]="formTree.isDefault" />
|
|
969
|
-
<span>{{ 'localization.language.default' | translate }}</span>
|
|
970
|
-
</label>
|
|
783
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
784
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
971
785
|
</div>
|
|
972
786
|
|
|
973
787
|
<!-- Actions -->
|
|
974
788
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
975
789
|
<button
|
|
976
|
-
|
|
790
|
+
fButton
|
|
977
791
|
severity="secondary"
|
|
978
792
|
[outlined]="true"
|
|
979
793
|
(click)="onCancel()"
|
|
@@ -981,12 +795,12 @@ class LanguageFormPage {
|
|
|
981
795
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
982
796
|
</button>
|
|
983
797
|
<button
|
|
984
|
-
|
|
798
|
+
fButton
|
|
985
799
|
type="submit"
|
|
986
800
|
[disabled]="!isFormValid() || isSaving()"
|
|
987
801
|
>
|
|
988
802
|
@if (isSaving()) {
|
|
989
|
-
<
|
|
803
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
990
804
|
}
|
|
991
805
|
<span pButtonLabel>{{
|
|
992
806
|
isEditMode()
|
|
@@ -996,16 +810,17 @@ class LanguageFormPage {
|
|
|
996
810
|
</button>
|
|
997
811
|
</div>
|
|
998
812
|
</form>
|
|
999
|
-
</
|
|
1000
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type:
|
|
813
|
+
</f-card>
|
|
814
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: UiModule }, { kind: "directive", type: i1.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i1.CheckboxComponent, selector: "f-checkbox", inputs: ["label", "binary", "disabled", "inputId", "invalid", "indeterminate", "touched", "styleClass", "checked"], outputs: ["onChange", "onBlur", "touch", "checkedChange"] }, { kind: "directive", type: i1.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i1.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "component", type: i1.CardComponent, selector: "f-card", inputs: ["header", "subheader", "styleClass"] }, { kind: "component", type: i1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
1001
815
|
}
|
|
1002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageFormPage, decorators: [{
|
|
1003
817
|
type: Component,
|
|
1004
818
|
args: [{
|
|
1005
819
|
selector: 'lib-language-form-page',
|
|
1006
|
-
imports: [
|
|
820
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
821
|
+
providers: [MessageService],
|
|
1007
822
|
template: `
|
|
1008
|
-
<
|
|
823
|
+
<f-card>
|
|
1009
824
|
<ng-template #header>
|
|
1010
825
|
<div class="flex justify-between items-center p-4">
|
|
1011
826
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1028,7 +843,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1028
843
|
>{{ 'localization.language.code' | translate }} *</label
|
|
1029
844
|
>
|
|
1030
845
|
<input
|
|
1031
|
-
|
|
846
|
+
fInputText
|
|
1032
847
|
id="code"
|
|
1033
848
|
[formField]="formTree.code"
|
|
1034
849
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -1044,7 +859,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1044
859
|
>{{ 'localization.language.name' | translate }} *</label
|
|
1045
860
|
>
|
|
1046
861
|
<input
|
|
1047
|
-
|
|
862
|
+
fInputText
|
|
1048
863
|
id="name"
|
|
1049
864
|
[formField]="formTree.name"
|
|
1050
865
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -1057,7 +872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1057
872
|
'localization.language.native.name' | translate
|
|
1058
873
|
}}</label>
|
|
1059
874
|
<input
|
|
1060
|
-
|
|
875
|
+
fInputText
|
|
1061
876
|
id="nativeName"
|
|
1062
877
|
[formField]="formTree.nativeName"
|
|
1063
878
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -1072,7 +887,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1072
887
|
<label for="direction" class="font-medium"
|
|
1073
888
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
1074
889
|
>
|
|
1075
|
-
<
|
|
890
|
+
<f-select
|
|
1076
891
|
id="direction"
|
|
1077
892
|
[ngModel]="formModel().direction"
|
|
1078
893
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -1090,7 +905,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1090
905
|
'localization.language.display.order' | translate
|
|
1091
906
|
}}</label>
|
|
1092
907
|
<input
|
|
1093
|
-
|
|
908
|
+
fInputText
|
|
1094
909
|
id="serial"
|
|
1095
910
|
type="number"
|
|
1096
911
|
[formField]="formTree.serial"
|
|
@@ -1103,20 +918,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1103
918
|
|
|
1104
919
|
<!-- Checkboxes -->
|
|
1105
920
|
<div class="flex items-center gap-6 md:col-span-2 pt-4">
|
|
1106
|
-
<
|
|
1107
|
-
|
|
1108
|
-
<span>{{ 'shared.active' | translate }}</span>
|
|
1109
|
-
</label>
|
|
1110
|
-
<label class="p-checkbox-native">
|
|
1111
|
-
<input type="checkbox" [formField]="formTree.isDefault" />
|
|
1112
|
-
<span>{{ 'localization.language.default' | translate }}</span>
|
|
1113
|
-
</label>
|
|
921
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
922
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
1114
923
|
</div>
|
|
1115
924
|
|
|
1116
925
|
<!-- Actions -->
|
|
1117
926
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
1118
927
|
<button
|
|
1119
|
-
|
|
928
|
+
fButton
|
|
1120
929
|
severity="secondary"
|
|
1121
930
|
[outlined]="true"
|
|
1122
931
|
(click)="onCancel()"
|
|
@@ -1124,12 +933,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1124
933
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
1125
934
|
</button>
|
|
1126
935
|
<button
|
|
1127
|
-
|
|
936
|
+
fButton
|
|
1128
937
|
type="submit"
|
|
1129
938
|
[disabled]="!isFormValid() || isSaving()"
|
|
1130
939
|
>
|
|
1131
940
|
@if (isSaving()) {
|
|
1132
|
-
<
|
|
941
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
1133
942
|
}
|
|
1134
943
|
<span pButtonLabel>{{
|
|
1135
944
|
isEditMode()
|
|
@@ -1139,7 +948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1139
948
|
</button>
|
|
1140
949
|
</div>
|
|
1141
950
|
</form>
|
|
1142
|
-
</
|
|
951
|
+
</f-card>
|
|
1143
952
|
`,
|
|
1144
953
|
}]
|
|
1145
954
|
}], ctorParameters: () => [] });
|
|
@@ -1174,7 +983,7 @@ class LanguageListPage {
|
|
|
1174
983
|
this.confirmationService.confirm({
|
|
1175
984
|
message: this.translateService.translate('localization.language.confirm.set.default', { name: lang.name }),
|
|
1176
985
|
header: this.translateService.translate('localization.language.set.default'),
|
|
1177
|
-
icon: '
|
|
986
|
+
icon: 'star',
|
|
1178
987
|
accept: () => {
|
|
1179
988
|
this.languageService
|
|
1180
989
|
.setDefault(lang.id)
|
|
@@ -1200,7 +1009,7 @@ class LanguageListPage {
|
|
|
1200
1009
|
this.confirmationService.confirm({
|
|
1201
1010
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
1202
1011
|
header: this.translateService.translate('localization.language.delete.title'),
|
|
1203
|
-
icon: '
|
|
1012
|
+
icon: 'exclamation-triangle',
|
|
1204
1013
|
acceptButtonStyleClass: 'p-button-danger',
|
|
1205
1014
|
accept: () => {
|
|
1206
1015
|
from(this.languageService.delete({ id: lang.id, type: 'delete' }))
|
|
@@ -1222,8 +1031,8 @@ class LanguageListPage {
|
|
|
1222
1031
|
},
|
|
1223
1032
|
});
|
|
1224
1033
|
}
|
|
1225
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1226
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1034
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1035
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LanguageListPage, isStandalone: true, selector: "lib-language-list-page", providers: [ConfirmationService, MessageService], ngImport: i0, template: `
|
|
1227
1036
|
<div class="card">
|
|
1228
1037
|
<div
|
|
1229
1038
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -1237,21 +1046,20 @@ class LanguageListPage {
|
|
|
1237
1046
|
</p>
|
|
1238
1047
|
</div>
|
|
1239
1048
|
<button
|
|
1240
|
-
|
|
1049
|
+
fButton
|
|
1241
1050
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1242
1051
|
(click)="onCreate()"
|
|
1243
1052
|
class="w-full sm:w-auto"
|
|
1244
1053
|
>
|
|
1245
|
-
<
|
|
1054
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1246
1055
|
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1247
1056
|
</button>
|
|
1248
1057
|
</div>
|
|
1249
1058
|
|
|
1250
1059
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1251
|
-
<
|
|
1060
|
+
<f-table
|
|
1252
1061
|
[value]="languageService.data()"
|
|
1253
1062
|
[loading]="languageService.isLoading()"
|
|
1254
|
-
styleClass="p-datatable-sm"
|
|
1255
1063
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1256
1064
|
>
|
|
1257
1065
|
<ng-template #header>
|
|
@@ -1273,7 +1081,7 @@ class LanguageListPage {
|
|
|
1273
1081
|
<td>{{ lang.name }}</td>
|
|
1274
1082
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1275
1083
|
<td>
|
|
1276
|
-
<
|
|
1084
|
+
<f-tag
|
|
1277
1085
|
[value]="
|
|
1278
1086
|
lang.direction === 'rtl'
|
|
1279
1087
|
? ('localization.language.rtl' | translate)
|
|
@@ -1284,7 +1092,7 @@ class LanguageListPage {
|
|
|
1284
1092
|
</td>
|
|
1285
1093
|
<td>
|
|
1286
1094
|
<div class="flex gap-1 items-center">
|
|
1287
|
-
<
|
|
1095
|
+
<f-tag
|
|
1288
1096
|
[value]="
|
|
1289
1097
|
lang.isActive
|
|
1290
1098
|
? ('shared.active' | translate)
|
|
@@ -1293,7 +1101,7 @@ class LanguageListPage {
|
|
|
1293
1101
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1294
1102
|
/>
|
|
1295
1103
|
@if (lang.isDefault) {
|
|
1296
|
-
<
|
|
1104
|
+
<f-tag
|
|
1297
1105
|
[value]="'localization.language.default' | translate"
|
|
1298
1106
|
severity="contrast"
|
|
1299
1107
|
/>
|
|
@@ -1304,40 +1112,40 @@ class LanguageListPage {
|
|
|
1304
1112
|
<div class="flex gap-1">
|
|
1305
1113
|
@if (!lang.isDefault) {
|
|
1306
1114
|
<button
|
|
1307
|
-
|
|
1115
|
+
fButton
|
|
1308
1116
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1309
1117
|
[text]="true"
|
|
1310
1118
|
size="small"
|
|
1311
|
-
[
|
|
1119
|
+
[fTooltip]="
|
|
1312
1120
|
'localization.language.set.default' | translate
|
|
1313
1121
|
"
|
|
1314
1122
|
(click)="onSetDefault(lang)"
|
|
1315
1123
|
>
|
|
1316
|
-
<
|
|
1124
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1317
1125
|
</button>
|
|
1318
1126
|
}
|
|
1319
1127
|
<button
|
|
1320
|
-
|
|
1128
|
+
fButton
|
|
1321
1129
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1322
1130
|
[text]="true"
|
|
1323
1131
|
severity="secondary"
|
|
1324
1132
|
size="small"
|
|
1325
|
-
[
|
|
1133
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1326
1134
|
(click)="onEdit(lang.id)"
|
|
1327
1135
|
>
|
|
1328
|
-
<
|
|
1136
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1329
1137
|
</button>
|
|
1330
1138
|
<button
|
|
1331
|
-
|
|
1139
|
+
fButton
|
|
1332
1140
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1333
1141
|
[text]="true"
|
|
1334
1142
|
severity="danger"
|
|
1335
1143
|
size="small"
|
|
1336
|
-
[
|
|
1144
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1337
1145
|
[disabled]="lang.isDefault"
|
|
1338
1146
|
(click)="onDelete(lang)"
|
|
1339
1147
|
>
|
|
1340
|
-
<
|
|
1148
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1341
1149
|
</button>
|
|
1342
1150
|
</div>
|
|
1343
1151
|
</td>
|
|
@@ -1351,16 +1159,20 @@ class LanguageListPage {
|
|
|
1351
1159
|
</td>
|
|
1352
1160
|
</tr>
|
|
1353
1161
|
</ng-template>
|
|
1354
|
-
</
|
|
1162
|
+
</f-table>
|
|
1355
1163
|
</div>
|
|
1356
1164
|
</div>
|
|
1357
|
-
|
|
1165
|
+
|
|
1166
|
+
<f-confirmdialog />
|
|
1167
|
+
<f-toast />
|
|
1168
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: UiModule }, { kind: "component", type: i1.ConfirmDialog, selector: "f-confirmdialog", inputs: ["key"] }, { kind: "component", type: i1.ToastComponent, selector: "f-toast", inputs: ["key", "position"] }, { kind: "directive", type: i1.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i1.TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color"] }, { kind: "component", type: i1.TableComponent, selector: "f-table", inputs: ["value", "lazy", "loading", "rows", "totalRecords", "rowHover", "dataKey", "scrollable", "paginator", "first", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate", "tableStyle", "styleClass", "globalFilterFields", "sortField", "sortOrder"], outputs: ["sortFieldChange", "sortOrderChange", "onLazyLoad", "onSort"] }, { kind: "directive", type: i1.TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay"] }, { kind: "component", type: i1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
1358
1169
|
}
|
|
1359
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageListPage, decorators: [{
|
|
1360
1171
|
type: Component,
|
|
1361
1172
|
args: [{
|
|
1362
1173
|
selector: 'lib-language-list-page',
|
|
1363
|
-
imports: [AngularModule,
|
|
1174
|
+
imports: [AngularModule, UiModule, HasPermissionDirective, TranslatePipe],
|
|
1175
|
+
providers: [ConfirmationService, MessageService],
|
|
1364
1176
|
template: `
|
|
1365
1177
|
<div class="card">
|
|
1366
1178
|
<div
|
|
@@ -1375,21 +1187,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1375
1187
|
</p>
|
|
1376
1188
|
</div>
|
|
1377
1189
|
<button
|
|
1378
|
-
|
|
1190
|
+
fButton
|
|
1379
1191
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1380
1192
|
(click)="onCreate()"
|
|
1381
1193
|
class="w-full sm:w-auto"
|
|
1382
1194
|
>
|
|
1383
|
-
<
|
|
1195
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1384
1196
|
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1385
1197
|
</button>
|
|
1386
1198
|
</div>
|
|
1387
1199
|
|
|
1388
1200
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1389
|
-
<
|
|
1201
|
+
<f-table
|
|
1390
1202
|
[value]="languageService.data()"
|
|
1391
1203
|
[loading]="languageService.isLoading()"
|
|
1392
|
-
styleClass="p-datatable-sm"
|
|
1393
1204
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1394
1205
|
>
|
|
1395
1206
|
<ng-template #header>
|
|
@@ -1411,7 +1222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1411
1222
|
<td>{{ lang.name }}</td>
|
|
1412
1223
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1413
1224
|
<td>
|
|
1414
|
-
<
|
|
1225
|
+
<f-tag
|
|
1415
1226
|
[value]="
|
|
1416
1227
|
lang.direction === 'rtl'
|
|
1417
1228
|
? ('localization.language.rtl' | translate)
|
|
@@ -1422,7 +1233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1422
1233
|
</td>
|
|
1423
1234
|
<td>
|
|
1424
1235
|
<div class="flex gap-1 items-center">
|
|
1425
|
-
<
|
|
1236
|
+
<f-tag
|
|
1426
1237
|
[value]="
|
|
1427
1238
|
lang.isActive
|
|
1428
1239
|
? ('shared.active' | translate)
|
|
@@ -1431,7 +1242,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1431
1242
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1432
1243
|
/>
|
|
1433
1244
|
@if (lang.isDefault) {
|
|
1434
|
-
<
|
|
1245
|
+
<f-tag
|
|
1435
1246
|
[value]="'localization.language.default' | translate"
|
|
1436
1247
|
severity="contrast"
|
|
1437
1248
|
/>
|
|
@@ -1442,40 +1253,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1442
1253
|
<div class="flex gap-1">
|
|
1443
1254
|
@if (!lang.isDefault) {
|
|
1444
1255
|
<button
|
|
1445
|
-
|
|
1256
|
+
fButton
|
|
1446
1257
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1447
1258
|
[text]="true"
|
|
1448
1259
|
size="small"
|
|
1449
|
-
[
|
|
1260
|
+
[fTooltip]="
|
|
1450
1261
|
'localization.language.set.default' | translate
|
|
1451
1262
|
"
|
|
1452
1263
|
(click)="onSetDefault(lang)"
|
|
1453
1264
|
>
|
|
1454
|
-
<
|
|
1265
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1455
1266
|
</button>
|
|
1456
1267
|
}
|
|
1457
1268
|
<button
|
|
1458
|
-
|
|
1269
|
+
fButton
|
|
1459
1270
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1460
1271
|
[text]="true"
|
|
1461
1272
|
severity="secondary"
|
|
1462
1273
|
size="small"
|
|
1463
|
-
[
|
|
1274
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1464
1275
|
(click)="onEdit(lang.id)"
|
|
1465
1276
|
>
|
|
1466
|
-
<
|
|
1277
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1467
1278
|
</button>
|
|
1468
1279
|
<button
|
|
1469
|
-
|
|
1280
|
+
fButton
|
|
1470
1281
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1471
1282
|
[text]="true"
|
|
1472
1283
|
severity="danger"
|
|
1473
1284
|
size="small"
|
|
1474
|
-
[
|
|
1285
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1475
1286
|
[disabled]="lang.isDefault"
|
|
1476
1287
|
(click)="onDelete(lang)"
|
|
1477
1288
|
>
|
|
1478
|
-
<
|
|
1289
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1479
1290
|
</button>
|
|
1480
1291
|
</div>
|
|
1481
1292
|
</td>
|
|
@@ -1489,9 +1300,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1489
1300
|
</td>
|
|
1490
1301
|
</tr>
|
|
1491
1302
|
</ng-template>
|
|
1492
|
-
</
|
|
1303
|
+
</f-table>
|
|
1493
1304
|
</div>
|
|
1494
1305
|
</div>
|
|
1306
|
+
|
|
1307
|
+
<f-confirmdialog />
|
|
1308
|
+
<f-toast />
|
|
1495
1309
|
`,
|
|
1496
1310
|
}]
|
|
1497
1311
|
}] });
|
|
@@ -1507,14 +1321,14 @@ class LocalizationContainerPage {
|
|
|
1507
1321
|
{
|
|
1508
1322
|
id: 'languages',
|
|
1509
1323
|
labelKey: 'localization.tabs.languages',
|
|
1510
|
-
icon: '
|
|
1324
|
+
icon: 'globe',
|
|
1511
1325
|
route: 'languages',
|
|
1512
1326
|
permission: LANGUAGE_PERMISSIONS.READ,
|
|
1513
1327
|
},
|
|
1514
1328
|
{
|
|
1515
1329
|
id: 'keys',
|
|
1516
1330
|
labelKey: 'localization.tabs.keys',
|
|
1517
|
-
icon: '
|
|
1331
|
+
icon: 'key',
|
|
1518
1332
|
route: 'keys',
|
|
1519
1333
|
permission: TRANSLATION_KEY_PERMISSIONS.READ,
|
|
1520
1334
|
},
|
|
@@ -1527,8 +1341,8 @@ class LocalizationContainerPage {
|
|
|
1527
1341
|
return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));
|
|
1528
1342
|
}, /* @ts-ignore */
|
|
1529
1343
|
...(ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []));
|
|
1530
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1531
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationContainerPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LocalizationContainerPage, isStandalone: true, selector: "lib-localization-container", ngImport: i0, template: `
|
|
1532
1346
|
<div class="p-2 sm:p-4">
|
|
1533
1347
|
<div class="mb-4">
|
|
1534
1348
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1542,7 +1356,7 @@ class LocalizationContainerPage {
|
|
|
1542
1356
|
routerLinkActive="tab-active"
|
|
1543
1357
|
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"
|
|
1544
1358
|
>
|
|
1545
|
-
<
|
|
1359
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1546
1360
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1547
1361
|
</a>
|
|
1548
1362
|
}
|
|
@@ -1550,11 +1364,11 @@ class LocalizationContainerPage {
|
|
|
1550
1364
|
|
|
1551
1365
|
<router-outlet />
|
|
1552
1366
|
</div>
|
|
1553
|
-
`, isInline: true, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
1367
|
+
`, isInline: true, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: IconComponent, selector: "lib-icon", inputs: ["icon", "iconType"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
1554
1368
|
}
|
|
1555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationContainerPage, decorators: [{
|
|
1556
1370
|
type: Component,
|
|
1557
|
-
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], template: `
|
|
1371
|
+
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe, IconComponent], template: `
|
|
1558
1372
|
<div class="p-2 sm:p-4">
|
|
1559
1373
|
<div class="mb-4">
|
|
1560
1374
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1568,7 +1382,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1568
1382
|
routerLinkActive="tab-active"
|
|
1569
1383
|
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"
|
|
1570
1384
|
>
|
|
1571
|
-
<
|
|
1385
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1572
1386
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1573
1387
|
</a>
|
|
1574
1388
|
}
|
|
@@ -1886,9 +1700,9 @@ class TranslationKeyFormPage {
|
|
|
1886
1700
|
onCancel() {
|
|
1887
1701
|
this.router.navigate(['/localization/keys']);
|
|
1888
1702
|
}
|
|
1889
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1890
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1891
|
-
<
|
|
1703
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1704
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TranslationKeyFormPage, isStandalone: true, selector: "lib-translation-key-form-page", providers: [MessageService], ngImport: i0, template: `
|
|
1705
|
+
<f-card>
|
|
1892
1706
|
<ng-template #header>
|
|
1893
1707
|
<div class="flex justify-between items-center p-4">
|
|
1894
1708
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1914,7 +1728,7 @@ class TranslationKeyFormPage {
|
|
|
1914
1728
|
>{{ 'localization.key.name' | translate }} *</label
|
|
1915
1729
|
>
|
|
1916
1730
|
<input
|
|
1917
|
-
|
|
1731
|
+
fInputText
|
|
1918
1732
|
id="key"
|
|
1919
1733
|
[formField]="formTree.key"
|
|
1920
1734
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -1926,7 +1740,7 @@ class TranslationKeyFormPage {
|
|
|
1926
1740
|
<label for="module" class="font-medium"
|
|
1927
1741
|
>{{ 'localization.key.module' | translate }} *</label
|
|
1928
1742
|
>
|
|
1929
|
-
<
|
|
1743
|
+
<f-select
|
|
1930
1744
|
id="module"
|
|
1931
1745
|
[ngModel]="formModel().module"
|
|
1932
1746
|
(ngModelChange)="updateModule($event)"
|
|
@@ -1946,7 +1760,7 @@ class TranslationKeyFormPage {
|
|
|
1946
1760
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
1947
1761
|
>
|
|
1948
1762
|
<textarea
|
|
1949
|
-
|
|
1763
|
+
fTextarea
|
|
1950
1764
|
id="defaultMessage"
|
|
1951
1765
|
[formField]="formTree.defaultMessage"
|
|
1952
1766
|
[rows]="2"
|
|
@@ -1962,7 +1776,7 @@ class TranslationKeyFormPage {
|
|
|
1962
1776
|
'localization.key.description' | translate
|
|
1963
1777
|
}}</label>
|
|
1964
1778
|
<input
|
|
1965
|
-
|
|
1779
|
+
fInputText
|
|
1966
1780
|
id="description"
|
|
1967
1781
|
[formField]="formTree.description"
|
|
1968
1782
|
[placeholder]="
|
|
@@ -1977,7 +1791,7 @@ class TranslationKeyFormPage {
|
|
|
1977
1791
|
'localization.key.variables' | translate
|
|
1978
1792
|
}}</label>
|
|
1979
1793
|
<input
|
|
1980
|
-
|
|
1794
|
+
fInputText
|
|
1981
1795
|
id="variables"
|
|
1982
1796
|
[formField]="formTree.variables"
|
|
1983
1797
|
[placeholder]="
|
|
@@ -1998,7 +1812,7 @@ class TranslationKeyFormPage {
|
|
|
1998
1812
|
</h4>
|
|
1999
1813
|
@if (isLoadingLanguages()) {
|
|
2000
1814
|
<div class="flex justify-center py-4">
|
|
2001
|
-
<
|
|
1815
|
+
<f-progressspinner strokeWidth="4" />
|
|
2002
1816
|
</div>
|
|
2003
1817
|
} @else if (languages().length === 0) {
|
|
2004
1818
|
<p class="text-muted-color text-center py-4">
|
|
@@ -2017,14 +1831,14 @@ class TranslationKeyFormPage {
|
|
|
2017
1831
|
>
|
|
2018
1832
|
}
|
|
2019
1833
|
</label>
|
|
2020
|
-
<
|
|
1834
|
+
<f-tag
|
|
2021
1835
|
[value]="lang.code"
|
|
2022
1836
|
severity="secondary"
|
|
2023
1837
|
class="uppercase"
|
|
2024
1838
|
/>
|
|
2025
1839
|
</div>
|
|
2026
1840
|
<textarea
|
|
2027
|
-
|
|
1841
|
+
fTextarea
|
|
2028
1842
|
[ngModel]="getTranslationValue(lang.id)"
|
|
2029
1843
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
2030
1844
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2043,7 +1857,7 @@ class TranslationKeyFormPage {
|
|
|
2043
1857
|
<!-- Actions -->
|
|
2044
1858
|
<div class="flex justify-end gap-4 pt-4">
|
|
2045
1859
|
<button
|
|
2046
|
-
|
|
1860
|
+
fButton
|
|
2047
1861
|
severity="secondary"
|
|
2048
1862
|
[outlined]="true"
|
|
2049
1863
|
(click)="onCancel()"
|
|
@@ -2051,12 +1865,12 @@ class TranslationKeyFormPage {
|
|
|
2051
1865
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
2052
1866
|
</button>
|
|
2053
1867
|
<button
|
|
2054
|
-
|
|
1868
|
+
fButton
|
|
2055
1869
|
type="submit"
|
|
2056
1870
|
[disabled]="!isFormValid() || isSaving()"
|
|
2057
1871
|
>
|
|
2058
1872
|
@if (isSaving()) {
|
|
2059
|
-
<
|
|
1873
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
2060
1874
|
}
|
|
2061
1875
|
<span pButtonLabel>{{
|
|
2062
1876
|
isEditMode()
|
|
@@ -2066,16 +1880,17 @@ class TranslationKeyFormPage {
|
|
|
2066
1880
|
</button>
|
|
2067
1881
|
</div>
|
|
2068
1882
|
</form>
|
|
2069
|
-
</
|
|
2070
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type:
|
|
1883
|
+
</f-card>
|
|
1884
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: UiModule }, { kind: "directive", type: i1.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i1.ProgressSpinnerComponent, selector: "f-progressspinner", inputs: ["size", "strokeWidth"] }, { kind: "component", type: i1.TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color"] }, { kind: "directive", type: i1.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i1.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "directive", type: i1.TextareaDirective, selector: "[fTextarea]", inputs: ["invalid", "touched"] }, { kind: "component", type: i1.CardComponent, selector: "f-card", inputs: ["header", "subheader", "styleClass"] }, { kind: "component", type: i1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2071
1885
|
}
|
|
2072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyFormPage, decorators: [{
|
|
2073
1887
|
type: Component,
|
|
2074
1888
|
args: [{
|
|
2075
1889
|
selector: 'lib-translation-key-form-page',
|
|
2076
|
-
imports: [
|
|
1890
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
1891
|
+
providers: [MessageService],
|
|
2077
1892
|
template: `
|
|
2078
|
-
<
|
|
1893
|
+
<f-card>
|
|
2079
1894
|
<ng-template #header>
|
|
2080
1895
|
<div class="flex justify-between items-center p-4">
|
|
2081
1896
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -2101,7 +1916,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2101
1916
|
>{{ 'localization.key.name' | translate }} *</label
|
|
2102
1917
|
>
|
|
2103
1918
|
<input
|
|
2104
|
-
|
|
1919
|
+
fInputText
|
|
2105
1920
|
id="key"
|
|
2106
1921
|
[formField]="formTree.key"
|
|
2107
1922
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -2113,7 +1928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2113
1928
|
<label for="module" class="font-medium"
|
|
2114
1929
|
>{{ 'localization.key.module' | translate }} *</label
|
|
2115
1930
|
>
|
|
2116
|
-
<
|
|
1931
|
+
<f-select
|
|
2117
1932
|
id="module"
|
|
2118
1933
|
[ngModel]="formModel().module"
|
|
2119
1934
|
(ngModelChange)="updateModule($event)"
|
|
@@ -2133,7 +1948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2133
1948
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
2134
1949
|
>
|
|
2135
1950
|
<textarea
|
|
2136
|
-
|
|
1951
|
+
fTextarea
|
|
2137
1952
|
id="defaultMessage"
|
|
2138
1953
|
[formField]="formTree.defaultMessage"
|
|
2139
1954
|
[rows]="2"
|
|
@@ -2149,7 +1964,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2149
1964
|
'localization.key.description' | translate
|
|
2150
1965
|
}}</label>
|
|
2151
1966
|
<input
|
|
2152
|
-
|
|
1967
|
+
fInputText
|
|
2153
1968
|
id="description"
|
|
2154
1969
|
[formField]="formTree.description"
|
|
2155
1970
|
[placeholder]="
|
|
@@ -2164,7 +1979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2164
1979
|
'localization.key.variables' | translate
|
|
2165
1980
|
}}</label>
|
|
2166
1981
|
<input
|
|
2167
|
-
|
|
1982
|
+
fInputText
|
|
2168
1983
|
id="variables"
|
|
2169
1984
|
[formField]="formTree.variables"
|
|
2170
1985
|
[placeholder]="
|
|
@@ -2185,7 +2000,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2185
2000
|
</h4>
|
|
2186
2001
|
@if (isLoadingLanguages()) {
|
|
2187
2002
|
<div class="flex justify-center py-4">
|
|
2188
|
-
<
|
|
2003
|
+
<f-progressspinner strokeWidth="4" />
|
|
2189
2004
|
</div>
|
|
2190
2005
|
} @else if (languages().length === 0) {
|
|
2191
2006
|
<p class="text-muted-color text-center py-4">
|
|
@@ -2204,14 +2019,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2204
2019
|
>
|
|
2205
2020
|
}
|
|
2206
2021
|
</label>
|
|
2207
|
-
<
|
|
2022
|
+
<f-tag
|
|
2208
2023
|
[value]="lang.code"
|
|
2209
2024
|
severity="secondary"
|
|
2210
2025
|
class="uppercase"
|
|
2211
2026
|
/>
|
|
2212
2027
|
</div>
|
|
2213
2028
|
<textarea
|
|
2214
|
-
|
|
2029
|
+
fTextarea
|
|
2215
2030
|
[ngModel]="getTranslationValue(lang.id)"
|
|
2216
2031
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
2217
2032
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2230,7 +2045,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2230
2045
|
<!-- Actions -->
|
|
2231
2046
|
<div class="flex justify-end gap-4 pt-4">
|
|
2232
2047
|
<button
|
|
2233
|
-
|
|
2048
|
+
fButton
|
|
2234
2049
|
severity="secondary"
|
|
2235
2050
|
[outlined]="true"
|
|
2236
2051
|
(click)="onCancel()"
|
|
@@ -2238,12 +2053,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2238
2053
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
2239
2054
|
</button>
|
|
2240
2055
|
<button
|
|
2241
|
-
|
|
2056
|
+
fButton
|
|
2242
2057
|
type="submit"
|
|
2243
2058
|
[disabled]="!isFormValid() || isSaving()"
|
|
2244
2059
|
>
|
|
2245
2060
|
@if (isSaving()) {
|
|
2246
|
-
<
|
|
2061
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
2247
2062
|
}
|
|
2248
2063
|
<span pButtonLabel>{{
|
|
2249
2064
|
isEditMode()
|
|
@@ -2253,7 +2068,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2253
2068
|
</button>
|
|
2254
2069
|
</div>
|
|
2255
2070
|
</form>
|
|
2256
|
-
</
|
|
2071
|
+
</f-card>
|
|
2257
2072
|
`,
|
|
2258
2073
|
}]
|
|
2259
2074
|
}], ctorParameters: () => [] });
|
|
@@ -2373,7 +2188,7 @@ class TranslationKeyListPage {
|
|
|
2373
2188
|
this.confirmationService.confirm({
|
|
2374
2189
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
2375
2190
|
header: this.translateService.translate('localization.key.delete.title'),
|
|
2376
|
-
icon: '
|
|
2191
|
+
icon: 'exclamation-triangle',
|
|
2377
2192
|
acceptButtonStyleClass: 'p-button-danger',
|
|
2378
2193
|
accept: () => {
|
|
2379
2194
|
from(this.translationKeyService.delete({ id: key.id, type: 'delete' }))
|
|
@@ -2395,8 +2210,8 @@ class TranslationKeyListPage {
|
|
|
2395
2210
|
},
|
|
2396
2211
|
});
|
|
2397
2212
|
}
|
|
2398
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2399
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
2213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2214
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TranslationKeyListPage, isStandalone: true, selector: "lib-translation-key-list-page", ngImport: i0, template: `
|
|
2400
2215
|
<div class="card">
|
|
2401
2216
|
<div
|
|
2402
2217
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -2411,11 +2226,11 @@ class TranslationKeyListPage {
|
|
|
2411
2226
|
</div>
|
|
2412
2227
|
<div class="flex gap-2">
|
|
2413
2228
|
<button
|
|
2414
|
-
|
|
2229
|
+
fButton
|
|
2415
2230
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2416
2231
|
(click)="onCreate()"
|
|
2417
2232
|
>
|
|
2418
|
-
<
|
|
2233
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2419
2234
|
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2420
2235
|
</button>
|
|
2421
2236
|
</div>
|
|
@@ -2423,7 +2238,7 @@ class TranslationKeyListPage {
|
|
|
2423
2238
|
|
|
2424
2239
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2425
2240
|
<div class="flex-1">
|
|
2426
|
-
<
|
|
2241
|
+
<f-select
|
|
2427
2242
|
[options]="moduleOptions()"
|
|
2428
2243
|
[ngModel]="selectedModule()"
|
|
2429
2244
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2436,28 +2251,27 @@ class TranslationKeyListPage {
|
|
|
2436
2251
|
/>
|
|
2437
2252
|
</div>
|
|
2438
2253
|
<div class="flex-1">
|
|
2439
|
-
<
|
|
2440
|
-
<
|
|
2254
|
+
<f-iconfield class="w-full">
|
|
2255
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2441
2256
|
<input
|
|
2442
|
-
|
|
2257
|
+
fInputText
|
|
2443
2258
|
[ngModel]="searchTerm()"
|
|
2444
2259
|
(ngModelChange)="searchTerm.set($event)"
|
|
2445
2260
|
[ngModelOptions]="{ standalone: true }"
|
|
2446
2261
|
[placeholder]="'shared.search' | translate"
|
|
2447
2262
|
class="w-full"
|
|
2448
2263
|
/>
|
|
2449
|
-
</
|
|
2264
|
+
</f-iconfield>
|
|
2450
2265
|
</div>
|
|
2451
2266
|
</div>
|
|
2452
2267
|
|
|
2453
2268
|
<!-- Table -->
|
|
2454
|
-
<
|
|
2269
|
+
<f-table
|
|
2455
2270
|
[value]="filteredKeys()"
|
|
2456
2271
|
[loading]="isLoading()"
|
|
2457
2272
|
[paginator]="true"
|
|
2458
2273
|
[rows]="15"
|
|
2459
2274
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2460
|
-
class="p-datatable-sm"
|
|
2461
2275
|
>
|
|
2462
2276
|
<ng-template #header>
|
|
2463
2277
|
<tr>
|
|
@@ -2481,7 +2295,7 @@ class TranslationKeyListPage {
|
|
|
2481
2295
|
@let languageCount = languages().length;
|
|
2482
2296
|
<tr>
|
|
2483
2297
|
<td>
|
|
2484
|
-
<
|
|
2298
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2485
2299
|
</td>
|
|
2486
2300
|
<td>
|
|
2487
2301
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2505,26 +2319,26 @@ class TranslationKeyListPage {
|
|
|
2505
2319
|
<td>
|
|
2506
2320
|
<div class="flex gap-1">
|
|
2507
2321
|
<button
|
|
2508
|
-
|
|
2322
|
+
fButton
|
|
2509
2323
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2510
2324
|
[text]="true"
|
|
2511
2325
|
severity="secondary"
|
|
2512
2326
|
size="small"
|
|
2513
|
-
[
|
|
2327
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2514
2328
|
(click)="onEdit(key)"
|
|
2515
2329
|
>
|
|
2516
|
-
<
|
|
2330
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2517
2331
|
</button>
|
|
2518
2332
|
<button
|
|
2519
|
-
|
|
2333
|
+
fButton
|
|
2520
2334
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2521
2335
|
[text]="true"
|
|
2522
2336
|
severity="danger"
|
|
2523
2337
|
size="small"
|
|
2524
|
-
[
|
|
2338
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2525
2339
|
(click)="onDelete(key)"
|
|
2526
2340
|
>
|
|
2527
|
-
<
|
|
2341
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2528
2342
|
</button>
|
|
2529
2343
|
</div>
|
|
2530
2344
|
</td>
|
|
@@ -2537,17 +2351,20 @@ class TranslationKeyListPage {
|
|
|
2537
2351
|
</td>
|
|
2538
2352
|
</tr>
|
|
2539
2353
|
</ng-template>
|
|
2540
|
-
</
|
|
2354
|
+
</f-table>
|
|
2541
2355
|
</div>
|
|
2542
|
-
|
|
2356
|
+
|
|
2357
|
+
<f-confirmdialog />
|
|
2358
|
+
<f-toast />
|
|
2359
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: UiModule }, { kind: "component", type: i1.ConfirmDialog, selector: "f-confirmdialog", inputs: ["key"] }, { kind: "component", type: i1.ToastComponent, selector: "f-toast", inputs: ["key", "position"] }, { kind: "directive", type: i1.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i1.TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color"] }, { kind: "component", type: i1.IconFieldComponent, selector: "f-iconfield" }, { kind: "component", type: i1.InputIconComponent, selector: "f-inputicon", inputs: ["styleClass"] }, { kind: "directive", type: i1.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i1.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "component", type: i1.TableComponent, selector: "f-table", inputs: ["value", "lazy", "loading", "rows", "totalRecords", "rowHover", "dataKey", "scrollable", "paginator", "first", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate", "tableStyle", "styleClass", "globalFilterFields", "sortField", "sortOrder"], outputs: ["sortFieldChange", "sortOrderChange", "onLazyLoad", "onSort"] }, { kind: "directive", type: i1.TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay"] }, { kind: "component", type: i1.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2543
2360
|
}
|
|
2544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyListPage, decorators: [{
|
|
2545
2362
|
type: Component,
|
|
2546
2363
|
args: [{
|
|
2547
2364
|
selector: 'lib-translation-key-list-page',
|
|
2548
2365
|
imports: [
|
|
2549
2366
|
AngularModule,
|
|
2550
|
-
|
|
2367
|
+
UiModule,
|
|
2551
2368
|
FormsModule,
|
|
2552
2369
|
HasPermissionDirective,
|
|
2553
2370
|
TranslatePipe,
|
|
@@ -2567,11 +2384,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2567
2384
|
</div>
|
|
2568
2385
|
<div class="flex gap-2">
|
|
2569
2386
|
<button
|
|
2570
|
-
|
|
2387
|
+
fButton
|
|
2571
2388
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2572
2389
|
(click)="onCreate()"
|
|
2573
2390
|
>
|
|
2574
|
-
<
|
|
2391
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2575
2392
|
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2576
2393
|
</button>
|
|
2577
2394
|
</div>
|
|
@@ -2579,7 +2396,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2579
2396
|
|
|
2580
2397
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2581
2398
|
<div class="flex-1">
|
|
2582
|
-
<
|
|
2399
|
+
<f-select
|
|
2583
2400
|
[options]="moduleOptions()"
|
|
2584
2401
|
[ngModel]="selectedModule()"
|
|
2585
2402
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2592,28 +2409,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2592
2409
|
/>
|
|
2593
2410
|
</div>
|
|
2594
2411
|
<div class="flex-1">
|
|
2595
|
-
<
|
|
2596
|
-
<
|
|
2412
|
+
<f-iconfield class="w-full">
|
|
2413
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2597
2414
|
<input
|
|
2598
|
-
|
|
2415
|
+
fInputText
|
|
2599
2416
|
[ngModel]="searchTerm()"
|
|
2600
2417
|
(ngModelChange)="searchTerm.set($event)"
|
|
2601
2418
|
[ngModelOptions]="{ standalone: true }"
|
|
2602
2419
|
[placeholder]="'shared.search' | translate"
|
|
2603
2420
|
class="w-full"
|
|
2604
2421
|
/>
|
|
2605
|
-
</
|
|
2422
|
+
</f-iconfield>
|
|
2606
2423
|
</div>
|
|
2607
2424
|
</div>
|
|
2608
2425
|
|
|
2609
2426
|
<!-- Table -->
|
|
2610
|
-
<
|
|
2427
|
+
<f-table
|
|
2611
2428
|
[value]="filteredKeys()"
|
|
2612
2429
|
[loading]="isLoading()"
|
|
2613
2430
|
[paginator]="true"
|
|
2614
2431
|
[rows]="15"
|
|
2615
2432
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2616
|
-
class="p-datatable-sm"
|
|
2617
2433
|
>
|
|
2618
2434
|
<ng-template #header>
|
|
2619
2435
|
<tr>
|
|
@@ -2637,7 +2453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2637
2453
|
@let languageCount = languages().length;
|
|
2638
2454
|
<tr>
|
|
2639
2455
|
<td>
|
|
2640
|
-
<
|
|
2456
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2641
2457
|
</td>
|
|
2642
2458
|
<td>
|
|
2643
2459
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2661,26 +2477,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2661
2477
|
<td>
|
|
2662
2478
|
<div class="flex gap-1">
|
|
2663
2479
|
<button
|
|
2664
|
-
|
|
2480
|
+
fButton
|
|
2665
2481
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2666
2482
|
[text]="true"
|
|
2667
2483
|
severity="secondary"
|
|
2668
2484
|
size="small"
|
|
2669
|
-
[
|
|
2485
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2670
2486
|
(click)="onEdit(key)"
|
|
2671
2487
|
>
|
|
2672
|
-
<
|
|
2488
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2673
2489
|
</button>
|
|
2674
2490
|
<button
|
|
2675
|
-
|
|
2491
|
+
fButton
|
|
2676
2492
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2677
2493
|
[text]="true"
|
|
2678
2494
|
severity="danger"
|
|
2679
2495
|
size="small"
|
|
2680
|
-
[
|
|
2496
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2681
2497
|
(click)="onDelete(key)"
|
|
2682
2498
|
>
|
|
2683
|
-
<
|
|
2499
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2684
2500
|
</button>
|
|
2685
2501
|
</div>
|
|
2686
2502
|
</td>
|
|
@@ -2693,8 +2509,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2693
2509
|
</td>
|
|
2694
2510
|
</tr>
|
|
2695
2511
|
</ng-template>
|
|
2696
|
-
</
|
|
2512
|
+
</f-table>
|
|
2697
2513
|
</div>
|
|
2514
|
+
|
|
2515
|
+
<f-confirmdialog />
|
|
2516
|
+
<f-toast />
|
|
2698
2517
|
`,
|
|
2699
2518
|
}]
|
|
2700
2519
|
}] });
|