@flusys/ng-localization 5.5.0 → 6.0.0-beta.2
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 { PrimeNG } from 'primeng/config';
|
|
9
8
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
10
|
-
import * as i1 from '
|
|
11
|
-
import {
|
|
12
|
-
import { filter } from 'rxjs/operators';
|
|
9
|
+
import * as i1 from '@flusys/ng-ui';
|
|
10
|
+
import { UiModule, MenuComponent, MessageService, ConfirmationService } from '@flusys/ng-ui';
|
|
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,82 @@ 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
|
-
selectedLanguage = computed(() => this.languages().find((l) => l.code === this.selectedLanguageCode()) ??
|
|
412
|
+
selectedLanguage = computed(() => this.languages().find((l) => l.code === this.selectedLanguageCode()) ??
|
|
413
|
+
null, /* @ts-ignore */
|
|
509
414
|
...(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
|
-
}
|
|
415
|
+
menuItems = computed(() => this.languages().map((lang) => ({
|
|
416
|
+
label: lang.nativeName || lang.name,
|
|
417
|
+
badge: lang.code.toUpperCase(),
|
|
418
|
+
selected: lang.code === this.selectedLanguageCode(),
|
|
419
|
+
command: () => this.onLanguageSelect(lang.code),
|
|
420
|
+
})), /* @ts-ignore */
|
|
421
|
+
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
523
422
|
onLanguageSelect(code) {
|
|
524
423
|
const language = this.languages().find((l) => l.code === code);
|
|
525
424
|
if (language) {
|
|
526
425
|
this.localizationState.setCurrentLanguage(language);
|
|
527
|
-
this._isActive.set(false);
|
|
528
426
|
this.translationLoader
|
|
529
427
|
.loadTranslationsAsync(code, true)
|
|
530
428
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
531
429
|
.subscribe();
|
|
532
430
|
}
|
|
533
431
|
}
|
|
534
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
535
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
432
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
433
|
+
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
434
|
<button
|
|
537
435
|
type="button"
|
|
538
436
|
class="layout-topbar-action"
|
|
539
|
-
[class.layout-topbar-action-highlight]="
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
437
|
+
[class.layout-topbar-action-highlight]="menu.visible()"
|
|
438
|
+
(click)="menu.toggle($event)"
|
|
439
|
+
>
|
|
440
|
+
<ui-icon name="globe"></ui-icon>
|
|
441
|
+
<span class="font-semibold">{{
|
|
442
|
+
selectedLanguage()?.nativeName ||
|
|
443
|
+
selectedLanguage()?.name ||
|
|
444
|
+
selectedLanguageCode()
|
|
445
|
+
}}</span>
|
|
549
446
|
</button>
|
|
550
|
-
<
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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"] }] });
|
|
447
|
+
<f-menu
|
|
448
|
+
#menu
|
|
449
|
+
[model]="menuItems()"
|
|
450
|
+
[popup]="true"
|
|
451
|
+
class="absolute left-[0]"
|
|
452
|
+
style="inset-inline-end: 0;"
|
|
453
|
+
/>
|
|
454
|
+
`, 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
455
|
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
|
|
573
457
|
type: Component,
|
|
574
458
|
args: [{
|
|
575
459
|
selector: 'lib-language-selector',
|
|
576
|
-
imports: [
|
|
460
|
+
imports: [UiModule],
|
|
577
461
|
host: { class: 'relative' },
|
|
578
462
|
template: `
|
|
579
463
|
<button
|
|
580
464
|
type="button"
|
|
581
465
|
class="layout-topbar-action"
|
|
582
|
-
[class.layout-topbar-action-highlight]="
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
466
|
+
[class.layout-topbar-action-highlight]="menu.visible()"
|
|
467
|
+
(click)="menu.toggle($event)"
|
|
468
|
+
>
|
|
469
|
+
<ui-icon name="globe"></ui-icon>
|
|
470
|
+
<span class="font-semibold">{{
|
|
471
|
+
selectedLanguage()?.nativeName ||
|
|
472
|
+
selectedLanguage()?.name ||
|
|
473
|
+
selectedLanguageCode()
|
|
474
|
+
}}</span>
|
|
592
475
|
</button>
|
|
593
|
-
<
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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>
|
|
476
|
+
<f-menu
|
|
477
|
+
#menu
|
|
478
|
+
[model]="menuItems()"
|
|
479
|
+
[popup]="true"
|
|
480
|
+
class="absolute left-[0]"
|
|
481
|
+
style="inset-inline-end: 0;"
|
|
482
|
+
/>
|
|
613
483
|
`,
|
|
614
484
|
}]
|
|
615
|
-
}]
|
|
485
|
+
}] });
|
|
616
486
|
|
|
617
487
|
class LanguageSelectorPanelComponent {
|
|
618
488
|
localizationState = inject(LocalizationStateService);
|
|
@@ -622,6 +492,13 @@ class LanguageSelectorPanelComponent {
|
|
|
622
492
|
_selectedLanguageCode = signal(this.localizationState.currentLanguageCode(), /* @ts-ignore */
|
|
623
493
|
...(ngDevMode ? [{ debugName: "_selectedLanguageCode" }] : /* istanbul ignore next */ []));
|
|
624
494
|
selectedLanguageCode = this._selectedLanguageCode.asReadonly();
|
|
495
|
+
menuItems = computed(() => this.languages().map((lang) => ({
|
|
496
|
+
label: lang.nativeName || lang.name,
|
|
497
|
+
badge: lang.code.toUpperCase(),
|
|
498
|
+
selected: lang.code === this.selectedLanguageCode(),
|
|
499
|
+
command: () => this.onLanguageSelect(lang.code),
|
|
500
|
+
})), /* @ts-ignore */
|
|
501
|
+
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
625
502
|
constructor() {
|
|
626
503
|
effect(() => {
|
|
627
504
|
const currentCode = this.localizationState.currentLanguageCode();
|
|
@@ -641,53 +518,19 @@ class LanguageSelectorPanelComponent {
|
|
|
641
518
|
.subscribe();
|
|
642
519
|
}
|
|
643
520
|
}
|
|
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 });
|
|
521
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
522
|
+
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 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
523
|
}
|
|
664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorPanelComponent, decorators: [{
|
|
665
525
|
type: Component,
|
|
666
526
|
args: [{
|
|
667
527
|
selector: 'lib-language-selector-panel',
|
|
668
|
-
imports: [],
|
|
528
|
+
imports: [MenuComponent],
|
|
669
529
|
host: {
|
|
670
|
-
class: 'hidden absolute
|
|
530
|
+
class: 'hidden absolute 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
531
|
style: 'background-color: var(--surface-overlay); inset-inline-end: 0;',
|
|
672
532
|
},
|
|
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
|
-
`,
|
|
533
|
+
template: `<f-menu [model]="menuItems()" />`,
|
|
691
534
|
}]
|
|
692
535
|
}], ctorParameters: () => [] });
|
|
693
536
|
|
|
@@ -860,9 +703,9 @@ class LanguageFormPage {
|
|
|
860
703
|
onCancel() {
|
|
861
704
|
this.router.navigate(['/localization/languages']);
|
|
862
705
|
}
|
|
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
|
-
<
|
|
706
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
707
|
+
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: `
|
|
708
|
+
<f-card>
|
|
866
709
|
<ng-template #header>
|
|
867
710
|
<div class="flex justify-between items-center p-4">
|
|
868
711
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -885,7 +728,7 @@ class LanguageFormPage {
|
|
|
885
728
|
>{{ 'localization.language.code' | translate }} *</label
|
|
886
729
|
>
|
|
887
730
|
<input
|
|
888
|
-
|
|
731
|
+
fInputText
|
|
889
732
|
id="code"
|
|
890
733
|
[formField]="formTree.code"
|
|
891
734
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -901,7 +744,7 @@ class LanguageFormPage {
|
|
|
901
744
|
>{{ 'localization.language.name' | translate }} *</label
|
|
902
745
|
>
|
|
903
746
|
<input
|
|
904
|
-
|
|
747
|
+
fInputText
|
|
905
748
|
id="name"
|
|
906
749
|
[formField]="formTree.name"
|
|
907
750
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -914,7 +757,7 @@ class LanguageFormPage {
|
|
|
914
757
|
'localization.language.native.name' | translate
|
|
915
758
|
}}</label>
|
|
916
759
|
<input
|
|
917
|
-
|
|
760
|
+
fInputText
|
|
918
761
|
id="nativeName"
|
|
919
762
|
[formField]="formTree.nativeName"
|
|
920
763
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -929,7 +772,7 @@ class LanguageFormPage {
|
|
|
929
772
|
<label for="direction" class="font-medium"
|
|
930
773
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
931
774
|
>
|
|
932
|
-
<
|
|
775
|
+
<f-select
|
|
933
776
|
id="direction"
|
|
934
777
|
[ngModel]="formModel().direction"
|
|
935
778
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -947,7 +790,7 @@ class LanguageFormPage {
|
|
|
947
790
|
'localization.language.display.order' | translate
|
|
948
791
|
}}</label>
|
|
949
792
|
<input
|
|
950
|
-
|
|
793
|
+
fInputText
|
|
951
794
|
id="serial"
|
|
952
795
|
type="number"
|
|
953
796
|
[formField]="formTree.serial"
|
|
@@ -960,20 +803,14 @@ class LanguageFormPage {
|
|
|
960
803
|
|
|
961
804
|
<!-- Checkboxes -->
|
|
962
805
|
<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>
|
|
806
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
807
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
971
808
|
</div>
|
|
972
809
|
|
|
973
810
|
<!-- Actions -->
|
|
974
811
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
975
812
|
<button
|
|
976
|
-
|
|
813
|
+
fButton
|
|
977
814
|
severity="secondary"
|
|
978
815
|
[outlined]="true"
|
|
979
816
|
(click)="onCancel()"
|
|
@@ -981,12 +818,12 @@ class LanguageFormPage {
|
|
|
981
818
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
982
819
|
</button>
|
|
983
820
|
<button
|
|
984
|
-
|
|
821
|
+
fButton
|
|
985
822
|
type="submit"
|
|
986
823
|
[disabled]="!isFormValid() || isSaving()"
|
|
987
824
|
>
|
|
988
825
|
@if (isSaving()) {
|
|
989
|
-
<
|
|
826
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
990
827
|
}
|
|
991
828
|
<span pButtonLabel>{{
|
|
992
829
|
isEditMode()
|
|
@@ -996,16 +833,17 @@ class LanguageFormPage {
|
|
|
996
833
|
</button>
|
|
997
834
|
</div>
|
|
998
835
|
</form>
|
|
999
|
-
</
|
|
1000
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type:
|
|
836
|
+
</f-card>
|
|
837
|
+
`, 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
838
|
}
|
|
1002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageFormPage, decorators: [{
|
|
1003
840
|
type: Component,
|
|
1004
841
|
args: [{
|
|
1005
842
|
selector: 'lib-language-form-page',
|
|
1006
|
-
imports: [
|
|
843
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
844
|
+
providers: [MessageService],
|
|
1007
845
|
template: `
|
|
1008
|
-
<
|
|
846
|
+
<f-card>
|
|
1009
847
|
<ng-template #header>
|
|
1010
848
|
<div class="flex justify-between items-center p-4">
|
|
1011
849
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1028,7 +866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1028
866
|
>{{ 'localization.language.code' | translate }} *</label
|
|
1029
867
|
>
|
|
1030
868
|
<input
|
|
1031
|
-
|
|
869
|
+
fInputText
|
|
1032
870
|
id="code"
|
|
1033
871
|
[formField]="formTree.code"
|
|
1034
872
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -1044,7 +882,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1044
882
|
>{{ 'localization.language.name' | translate }} *</label
|
|
1045
883
|
>
|
|
1046
884
|
<input
|
|
1047
|
-
|
|
885
|
+
fInputText
|
|
1048
886
|
id="name"
|
|
1049
887
|
[formField]="formTree.name"
|
|
1050
888
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -1057,7 +895,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1057
895
|
'localization.language.native.name' | translate
|
|
1058
896
|
}}</label>
|
|
1059
897
|
<input
|
|
1060
|
-
|
|
898
|
+
fInputText
|
|
1061
899
|
id="nativeName"
|
|
1062
900
|
[formField]="formTree.nativeName"
|
|
1063
901
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -1072,7 +910,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1072
910
|
<label for="direction" class="font-medium"
|
|
1073
911
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
1074
912
|
>
|
|
1075
|
-
<
|
|
913
|
+
<f-select
|
|
1076
914
|
id="direction"
|
|
1077
915
|
[ngModel]="formModel().direction"
|
|
1078
916
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -1090,7 +928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1090
928
|
'localization.language.display.order' | translate
|
|
1091
929
|
}}</label>
|
|
1092
930
|
<input
|
|
1093
|
-
|
|
931
|
+
fInputText
|
|
1094
932
|
id="serial"
|
|
1095
933
|
type="number"
|
|
1096
934
|
[formField]="formTree.serial"
|
|
@@ -1103,20 +941,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1103
941
|
|
|
1104
942
|
<!-- Checkboxes -->
|
|
1105
943
|
<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>
|
|
944
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
945
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
1114
946
|
</div>
|
|
1115
947
|
|
|
1116
948
|
<!-- Actions -->
|
|
1117
949
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
1118
950
|
<button
|
|
1119
|
-
|
|
951
|
+
fButton
|
|
1120
952
|
severity="secondary"
|
|
1121
953
|
[outlined]="true"
|
|
1122
954
|
(click)="onCancel()"
|
|
@@ -1124,12 +956,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1124
956
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
1125
957
|
</button>
|
|
1126
958
|
<button
|
|
1127
|
-
|
|
959
|
+
fButton
|
|
1128
960
|
type="submit"
|
|
1129
961
|
[disabled]="!isFormValid() || isSaving()"
|
|
1130
962
|
>
|
|
1131
963
|
@if (isSaving()) {
|
|
1132
|
-
<
|
|
964
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
1133
965
|
}
|
|
1134
966
|
<span pButtonLabel>{{
|
|
1135
967
|
isEditMode()
|
|
@@ -1139,7 +971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1139
971
|
</button>
|
|
1140
972
|
</div>
|
|
1141
973
|
</form>
|
|
1142
|
-
</
|
|
974
|
+
</f-card>
|
|
1143
975
|
`,
|
|
1144
976
|
}]
|
|
1145
977
|
}], ctorParameters: () => [] });
|
|
@@ -1174,7 +1006,7 @@ class LanguageListPage {
|
|
|
1174
1006
|
this.confirmationService.confirm({
|
|
1175
1007
|
message: this.translateService.translate('localization.language.confirm.set.default', { name: lang.name }),
|
|
1176
1008
|
header: this.translateService.translate('localization.language.set.default'),
|
|
1177
|
-
icon: '
|
|
1009
|
+
icon: 'star',
|
|
1178
1010
|
accept: () => {
|
|
1179
1011
|
this.languageService
|
|
1180
1012
|
.setDefault(lang.id)
|
|
@@ -1200,7 +1032,7 @@ class LanguageListPage {
|
|
|
1200
1032
|
this.confirmationService.confirm({
|
|
1201
1033
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
1202
1034
|
header: this.translateService.translate('localization.language.delete.title'),
|
|
1203
|
-
icon: '
|
|
1035
|
+
icon: 'exclamation-triangle',
|
|
1204
1036
|
acceptButtonStyleClass: 'p-button-danger',
|
|
1205
1037
|
accept: () => {
|
|
1206
1038
|
from(this.languageService.delete({ id: lang.id, type: 'delete' }))
|
|
@@ -1222,8 +1054,8 @@ class LanguageListPage {
|
|
|
1222
1054
|
},
|
|
1223
1055
|
});
|
|
1224
1056
|
}
|
|
1225
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1226
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
1057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1058
|
+
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
1059
|
<div class="card">
|
|
1228
1060
|
<div
|
|
1229
1061
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -1237,21 +1069,20 @@ class LanguageListPage {
|
|
|
1237
1069
|
</p>
|
|
1238
1070
|
</div>
|
|
1239
1071
|
<button
|
|
1240
|
-
|
|
1072
|
+
fButton
|
|
1241
1073
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1242
1074
|
(click)="onCreate()"
|
|
1243
1075
|
class="w-full sm:w-auto"
|
|
1244
1076
|
>
|
|
1245
|
-
<
|
|
1077
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1246
1078
|
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1247
1079
|
</button>
|
|
1248
1080
|
</div>
|
|
1249
1081
|
|
|
1250
1082
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1251
|
-
<
|
|
1083
|
+
<f-table
|
|
1252
1084
|
[value]="languageService.data()"
|
|
1253
1085
|
[loading]="languageService.isLoading()"
|
|
1254
|
-
styleClass="p-datatable-sm"
|
|
1255
1086
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1256
1087
|
>
|
|
1257
1088
|
<ng-template #header>
|
|
@@ -1273,7 +1104,7 @@ class LanguageListPage {
|
|
|
1273
1104
|
<td>{{ lang.name }}</td>
|
|
1274
1105
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1275
1106
|
<td>
|
|
1276
|
-
<
|
|
1107
|
+
<f-tag
|
|
1277
1108
|
[value]="
|
|
1278
1109
|
lang.direction === 'rtl'
|
|
1279
1110
|
? ('localization.language.rtl' | translate)
|
|
@@ -1284,7 +1115,7 @@ class LanguageListPage {
|
|
|
1284
1115
|
</td>
|
|
1285
1116
|
<td>
|
|
1286
1117
|
<div class="flex gap-1 items-center">
|
|
1287
|
-
<
|
|
1118
|
+
<f-tag
|
|
1288
1119
|
[value]="
|
|
1289
1120
|
lang.isActive
|
|
1290
1121
|
? ('shared.active' | translate)
|
|
@@ -1293,7 +1124,7 @@ class LanguageListPage {
|
|
|
1293
1124
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1294
1125
|
/>
|
|
1295
1126
|
@if (lang.isDefault) {
|
|
1296
|
-
<
|
|
1127
|
+
<f-tag
|
|
1297
1128
|
[value]="'localization.language.default' | translate"
|
|
1298
1129
|
severity="contrast"
|
|
1299
1130
|
/>
|
|
@@ -1304,40 +1135,40 @@ class LanguageListPage {
|
|
|
1304
1135
|
<div class="flex gap-1">
|
|
1305
1136
|
@if (!lang.isDefault) {
|
|
1306
1137
|
<button
|
|
1307
|
-
|
|
1138
|
+
fButton
|
|
1308
1139
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1309
1140
|
[text]="true"
|
|
1310
1141
|
size="small"
|
|
1311
|
-
[
|
|
1142
|
+
[fTooltip]="
|
|
1312
1143
|
'localization.language.set.default' | translate
|
|
1313
1144
|
"
|
|
1314
1145
|
(click)="onSetDefault(lang)"
|
|
1315
1146
|
>
|
|
1316
|
-
<
|
|
1147
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1317
1148
|
</button>
|
|
1318
1149
|
}
|
|
1319
1150
|
<button
|
|
1320
|
-
|
|
1151
|
+
fButton
|
|
1321
1152
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1322
1153
|
[text]="true"
|
|
1323
1154
|
severity="secondary"
|
|
1324
1155
|
size="small"
|
|
1325
|
-
[
|
|
1156
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1326
1157
|
(click)="onEdit(lang.id)"
|
|
1327
1158
|
>
|
|
1328
|
-
<
|
|
1159
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1329
1160
|
</button>
|
|
1330
1161
|
<button
|
|
1331
|
-
|
|
1162
|
+
fButton
|
|
1332
1163
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1333
1164
|
[text]="true"
|
|
1334
1165
|
severity="danger"
|
|
1335
1166
|
size="small"
|
|
1336
|
-
[
|
|
1167
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1337
1168
|
[disabled]="lang.isDefault"
|
|
1338
1169
|
(click)="onDelete(lang)"
|
|
1339
1170
|
>
|
|
1340
|
-
<
|
|
1171
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1341
1172
|
</button>
|
|
1342
1173
|
</div>
|
|
1343
1174
|
</td>
|
|
@@ -1351,16 +1182,20 @@ class LanguageListPage {
|
|
|
1351
1182
|
</td>
|
|
1352
1183
|
</tr>
|
|
1353
1184
|
</ng-template>
|
|
1354
|
-
</
|
|
1185
|
+
</f-table>
|
|
1355
1186
|
</div>
|
|
1356
1187
|
</div>
|
|
1357
|
-
|
|
1188
|
+
|
|
1189
|
+
<f-confirmdialog />
|
|
1190
|
+
<f-toast />
|
|
1191
|
+
`, 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
1192
|
}
|
|
1359
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageListPage, decorators: [{
|
|
1360
1194
|
type: Component,
|
|
1361
1195
|
args: [{
|
|
1362
1196
|
selector: 'lib-language-list-page',
|
|
1363
|
-
imports: [AngularModule,
|
|
1197
|
+
imports: [AngularModule, UiModule, HasPermissionDirective, TranslatePipe],
|
|
1198
|
+
providers: [ConfirmationService, MessageService],
|
|
1364
1199
|
template: `
|
|
1365
1200
|
<div class="card">
|
|
1366
1201
|
<div
|
|
@@ -1375,21 +1210,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1375
1210
|
</p>
|
|
1376
1211
|
</div>
|
|
1377
1212
|
<button
|
|
1378
|
-
|
|
1213
|
+
fButton
|
|
1379
1214
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1380
1215
|
(click)="onCreate()"
|
|
1381
1216
|
class="w-full sm:w-auto"
|
|
1382
1217
|
>
|
|
1383
|
-
<
|
|
1218
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1384
1219
|
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1385
1220
|
</button>
|
|
1386
1221
|
</div>
|
|
1387
1222
|
|
|
1388
1223
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1389
|
-
<
|
|
1224
|
+
<f-table
|
|
1390
1225
|
[value]="languageService.data()"
|
|
1391
1226
|
[loading]="languageService.isLoading()"
|
|
1392
|
-
styleClass="p-datatable-sm"
|
|
1393
1227
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1394
1228
|
>
|
|
1395
1229
|
<ng-template #header>
|
|
@@ -1411,7 +1245,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1411
1245
|
<td>{{ lang.name }}</td>
|
|
1412
1246
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1413
1247
|
<td>
|
|
1414
|
-
<
|
|
1248
|
+
<f-tag
|
|
1415
1249
|
[value]="
|
|
1416
1250
|
lang.direction === 'rtl'
|
|
1417
1251
|
? ('localization.language.rtl' | translate)
|
|
@@ -1422,7 +1256,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1422
1256
|
</td>
|
|
1423
1257
|
<td>
|
|
1424
1258
|
<div class="flex gap-1 items-center">
|
|
1425
|
-
<
|
|
1259
|
+
<f-tag
|
|
1426
1260
|
[value]="
|
|
1427
1261
|
lang.isActive
|
|
1428
1262
|
? ('shared.active' | translate)
|
|
@@ -1431,7 +1265,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1431
1265
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1432
1266
|
/>
|
|
1433
1267
|
@if (lang.isDefault) {
|
|
1434
|
-
<
|
|
1268
|
+
<f-tag
|
|
1435
1269
|
[value]="'localization.language.default' | translate"
|
|
1436
1270
|
severity="contrast"
|
|
1437
1271
|
/>
|
|
@@ -1442,40 +1276,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1442
1276
|
<div class="flex gap-1">
|
|
1443
1277
|
@if (!lang.isDefault) {
|
|
1444
1278
|
<button
|
|
1445
|
-
|
|
1279
|
+
fButton
|
|
1446
1280
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1447
1281
|
[text]="true"
|
|
1448
1282
|
size="small"
|
|
1449
|
-
[
|
|
1283
|
+
[fTooltip]="
|
|
1450
1284
|
'localization.language.set.default' | translate
|
|
1451
1285
|
"
|
|
1452
1286
|
(click)="onSetDefault(lang)"
|
|
1453
1287
|
>
|
|
1454
|
-
<
|
|
1288
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1455
1289
|
</button>
|
|
1456
1290
|
}
|
|
1457
1291
|
<button
|
|
1458
|
-
|
|
1292
|
+
fButton
|
|
1459
1293
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1460
1294
|
[text]="true"
|
|
1461
1295
|
severity="secondary"
|
|
1462
1296
|
size="small"
|
|
1463
|
-
[
|
|
1297
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1464
1298
|
(click)="onEdit(lang.id)"
|
|
1465
1299
|
>
|
|
1466
|
-
<
|
|
1300
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1467
1301
|
</button>
|
|
1468
1302
|
<button
|
|
1469
|
-
|
|
1303
|
+
fButton
|
|
1470
1304
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1471
1305
|
[text]="true"
|
|
1472
1306
|
severity="danger"
|
|
1473
1307
|
size="small"
|
|
1474
|
-
[
|
|
1308
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1475
1309
|
[disabled]="lang.isDefault"
|
|
1476
1310
|
(click)="onDelete(lang)"
|
|
1477
1311
|
>
|
|
1478
|
-
<
|
|
1312
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1479
1313
|
</button>
|
|
1480
1314
|
</div>
|
|
1481
1315
|
</td>
|
|
@@ -1489,9 +1323,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1489
1323
|
</td>
|
|
1490
1324
|
</tr>
|
|
1491
1325
|
</ng-template>
|
|
1492
|
-
</
|
|
1326
|
+
</f-table>
|
|
1493
1327
|
</div>
|
|
1494
1328
|
</div>
|
|
1329
|
+
|
|
1330
|
+
<f-confirmdialog />
|
|
1331
|
+
<f-toast />
|
|
1495
1332
|
`,
|
|
1496
1333
|
}]
|
|
1497
1334
|
}] });
|
|
@@ -1507,14 +1344,14 @@ class LocalizationContainerPage {
|
|
|
1507
1344
|
{
|
|
1508
1345
|
id: 'languages',
|
|
1509
1346
|
labelKey: 'localization.tabs.languages',
|
|
1510
|
-
icon: '
|
|
1347
|
+
icon: 'globe',
|
|
1511
1348
|
route: 'languages',
|
|
1512
1349
|
permission: LANGUAGE_PERMISSIONS.READ,
|
|
1513
1350
|
},
|
|
1514
1351
|
{
|
|
1515
1352
|
id: 'keys',
|
|
1516
1353
|
labelKey: 'localization.tabs.keys',
|
|
1517
|
-
icon: '
|
|
1354
|
+
icon: 'key',
|
|
1518
1355
|
route: 'keys',
|
|
1519
1356
|
permission: TRANSLATION_KEY_PERMISSIONS.READ,
|
|
1520
1357
|
},
|
|
@@ -1527,8 +1364,8 @@ class LocalizationContainerPage {
|
|
|
1527
1364
|
return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));
|
|
1528
1365
|
}, /* @ts-ignore */
|
|
1529
1366
|
...(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.
|
|
1367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationContainerPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LocalizationContainerPage, isStandalone: true, selector: "lib-localization-container", ngImport: i0, template: `
|
|
1532
1369
|
<div class="p-2 sm:p-4">
|
|
1533
1370
|
<div class="mb-4">
|
|
1534
1371
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1542,7 +1379,7 @@ class LocalizationContainerPage {
|
|
|
1542
1379
|
routerLinkActive="tab-active"
|
|
1543
1380
|
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
1381
|
>
|
|
1545
|
-
<
|
|
1382
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1546
1383
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1547
1384
|
</a>
|
|
1548
1385
|
}
|
|
@@ -1550,11 +1387,11 @@ class LocalizationContainerPage {
|
|
|
1550
1387
|
|
|
1551
1388
|
<router-outlet />
|
|
1552
1389
|
</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" }] });
|
|
1390
|
+
`, 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
1391
|
}
|
|
1555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationContainerPage, decorators: [{
|
|
1556
1393
|
type: Component,
|
|
1557
|
-
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], template: `
|
|
1394
|
+
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe, IconComponent], template: `
|
|
1558
1395
|
<div class="p-2 sm:p-4">
|
|
1559
1396
|
<div class="mb-4">
|
|
1560
1397
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1568,7 +1405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1568
1405
|
routerLinkActive="tab-active"
|
|
1569
1406
|
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
1407
|
>
|
|
1571
|
-
<
|
|
1408
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1572
1409
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1573
1410
|
</a>
|
|
1574
1411
|
}
|
|
@@ -1886,9 +1723,9 @@ class TranslationKeyFormPage {
|
|
|
1886
1723
|
onCancel() {
|
|
1887
1724
|
this.router.navigate(['/localization/keys']);
|
|
1888
1725
|
}
|
|
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
|
-
<
|
|
1726
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1727
|
+
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: `
|
|
1728
|
+
<f-card>
|
|
1892
1729
|
<ng-template #header>
|
|
1893
1730
|
<div class="flex justify-between items-center p-4">
|
|
1894
1731
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1914,7 +1751,7 @@ class TranslationKeyFormPage {
|
|
|
1914
1751
|
>{{ 'localization.key.name' | translate }} *</label
|
|
1915
1752
|
>
|
|
1916
1753
|
<input
|
|
1917
|
-
|
|
1754
|
+
fInputText
|
|
1918
1755
|
id="key"
|
|
1919
1756
|
[formField]="formTree.key"
|
|
1920
1757
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -1926,7 +1763,7 @@ class TranslationKeyFormPage {
|
|
|
1926
1763
|
<label for="module" class="font-medium"
|
|
1927
1764
|
>{{ 'localization.key.module' | translate }} *</label
|
|
1928
1765
|
>
|
|
1929
|
-
<
|
|
1766
|
+
<f-select
|
|
1930
1767
|
id="module"
|
|
1931
1768
|
[ngModel]="formModel().module"
|
|
1932
1769
|
(ngModelChange)="updateModule($event)"
|
|
@@ -1946,7 +1783,7 @@ class TranslationKeyFormPage {
|
|
|
1946
1783
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
1947
1784
|
>
|
|
1948
1785
|
<textarea
|
|
1949
|
-
|
|
1786
|
+
fTextarea
|
|
1950
1787
|
id="defaultMessage"
|
|
1951
1788
|
[formField]="formTree.defaultMessage"
|
|
1952
1789
|
[rows]="2"
|
|
@@ -1962,7 +1799,7 @@ class TranslationKeyFormPage {
|
|
|
1962
1799
|
'localization.key.description' | translate
|
|
1963
1800
|
}}</label>
|
|
1964
1801
|
<input
|
|
1965
|
-
|
|
1802
|
+
fInputText
|
|
1966
1803
|
id="description"
|
|
1967
1804
|
[formField]="formTree.description"
|
|
1968
1805
|
[placeholder]="
|
|
@@ -1977,7 +1814,7 @@ class TranslationKeyFormPage {
|
|
|
1977
1814
|
'localization.key.variables' | translate
|
|
1978
1815
|
}}</label>
|
|
1979
1816
|
<input
|
|
1980
|
-
|
|
1817
|
+
fInputText
|
|
1981
1818
|
id="variables"
|
|
1982
1819
|
[formField]="formTree.variables"
|
|
1983
1820
|
[placeholder]="
|
|
@@ -1998,7 +1835,7 @@ class TranslationKeyFormPage {
|
|
|
1998
1835
|
</h4>
|
|
1999
1836
|
@if (isLoadingLanguages()) {
|
|
2000
1837
|
<div class="flex justify-center py-4">
|
|
2001
|
-
<
|
|
1838
|
+
<f-progressspinner strokeWidth="4" />
|
|
2002
1839
|
</div>
|
|
2003
1840
|
} @else if (languages().length === 0) {
|
|
2004
1841
|
<p class="text-muted-color text-center py-4">
|
|
@@ -2017,14 +1854,14 @@ class TranslationKeyFormPage {
|
|
|
2017
1854
|
>
|
|
2018
1855
|
}
|
|
2019
1856
|
</label>
|
|
2020
|
-
<
|
|
1857
|
+
<f-tag
|
|
2021
1858
|
[value]="lang.code"
|
|
2022
1859
|
severity="secondary"
|
|
2023
1860
|
class="uppercase"
|
|
2024
1861
|
/>
|
|
2025
1862
|
</div>
|
|
2026
1863
|
<textarea
|
|
2027
|
-
|
|
1864
|
+
fTextarea
|
|
2028
1865
|
[ngModel]="getTranslationValue(lang.id)"
|
|
2029
1866
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
2030
1867
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2043,7 +1880,7 @@ class TranslationKeyFormPage {
|
|
|
2043
1880
|
<!-- Actions -->
|
|
2044
1881
|
<div class="flex justify-end gap-4 pt-4">
|
|
2045
1882
|
<button
|
|
2046
|
-
|
|
1883
|
+
fButton
|
|
2047
1884
|
severity="secondary"
|
|
2048
1885
|
[outlined]="true"
|
|
2049
1886
|
(click)="onCancel()"
|
|
@@ -2051,12 +1888,12 @@ class TranslationKeyFormPage {
|
|
|
2051
1888
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
2052
1889
|
</button>
|
|
2053
1890
|
<button
|
|
2054
|
-
|
|
1891
|
+
fButton
|
|
2055
1892
|
type="submit"
|
|
2056
1893
|
[disabled]="!isFormValid() || isSaving()"
|
|
2057
1894
|
>
|
|
2058
1895
|
@if (isSaving()) {
|
|
2059
|
-
<
|
|
1896
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
2060
1897
|
}
|
|
2061
1898
|
<span pButtonLabel>{{
|
|
2062
1899
|
isEditMode()
|
|
@@ -2066,16 +1903,17 @@ class TranslationKeyFormPage {
|
|
|
2066
1903
|
</button>
|
|
2067
1904
|
</div>
|
|
2068
1905
|
</form>
|
|
2069
|
-
</
|
|
2070
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type:
|
|
1906
|
+
</f-card>
|
|
1907
|
+
`, 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
1908
|
}
|
|
2072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyFormPage, decorators: [{
|
|
2073
1910
|
type: Component,
|
|
2074
1911
|
args: [{
|
|
2075
1912
|
selector: 'lib-translation-key-form-page',
|
|
2076
|
-
imports: [
|
|
1913
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
1914
|
+
providers: [MessageService],
|
|
2077
1915
|
template: `
|
|
2078
|
-
<
|
|
1916
|
+
<f-card>
|
|
2079
1917
|
<ng-template #header>
|
|
2080
1918
|
<div class="flex justify-between items-center p-4">
|
|
2081
1919
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -2101,7 +1939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2101
1939
|
>{{ 'localization.key.name' | translate }} *</label
|
|
2102
1940
|
>
|
|
2103
1941
|
<input
|
|
2104
|
-
|
|
1942
|
+
fInputText
|
|
2105
1943
|
id="key"
|
|
2106
1944
|
[formField]="formTree.key"
|
|
2107
1945
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -2113,7 +1951,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2113
1951
|
<label for="module" class="font-medium"
|
|
2114
1952
|
>{{ 'localization.key.module' | translate }} *</label
|
|
2115
1953
|
>
|
|
2116
|
-
<
|
|
1954
|
+
<f-select
|
|
2117
1955
|
id="module"
|
|
2118
1956
|
[ngModel]="formModel().module"
|
|
2119
1957
|
(ngModelChange)="updateModule($event)"
|
|
@@ -2133,7 +1971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2133
1971
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
2134
1972
|
>
|
|
2135
1973
|
<textarea
|
|
2136
|
-
|
|
1974
|
+
fTextarea
|
|
2137
1975
|
id="defaultMessage"
|
|
2138
1976
|
[formField]="formTree.defaultMessage"
|
|
2139
1977
|
[rows]="2"
|
|
@@ -2149,7 +1987,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2149
1987
|
'localization.key.description' | translate
|
|
2150
1988
|
}}</label>
|
|
2151
1989
|
<input
|
|
2152
|
-
|
|
1990
|
+
fInputText
|
|
2153
1991
|
id="description"
|
|
2154
1992
|
[formField]="formTree.description"
|
|
2155
1993
|
[placeholder]="
|
|
@@ -2164,7 +2002,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2164
2002
|
'localization.key.variables' | translate
|
|
2165
2003
|
}}</label>
|
|
2166
2004
|
<input
|
|
2167
|
-
|
|
2005
|
+
fInputText
|
|
2168
2006
|
id="variables"
|
|
2169
2007
|
[formField]="formTree.variables"
|
|
2170
2008
|
[placeholder]="
|
|
@@ -2185,7 +2023,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2185
2023
|
</h4>
|
|
2186
2024
|
@if (isLoadingLanguages()) {
|
|
2187
2025
|
<div class="flex justify-center py-4">
|
|
2188
|
-
<
|
|
2026
|
+
<f-progressspinner strokeWidth="4" />
|
|
2189
2027
|
</div>
|
|
2190
2028
|
} @else if (languages().length === 0) {
|
|
2191
2029
|
<p class="text-muted-color text-center py-4">
|
|
@@ -2204,14 +2042,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2204
2042
|
>
|
|
2205
2043
|
}
|
|
2206
2044
|
</label>
|
|
2207
|
-
<
|
|
2045
|
+
<f-tag
|
|
2208
2046
|
[value]="lang.code"
|
|
2209
2047
|
severity="secondary"
|
|
2210
2048
|
class="uppercase"
|
|
2211
2049
|
/>
|
|
2212
2050
|
</div>
|
|
2213
2051
|
<textarea
|
|
2214
|
-
|
|
2052
|
+
fTextarea
|
|
2215
2053
|
[ngModel]="getTranslationValue(lang.id)"
|
|
2216
2054
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
2217
2055
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2230,7 +2068,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2230
2068
|
<!-- Actions -->
|
|
2231
2069
|
<div class="flex justify-end gap-4 pt-4">
|
|
2232
2070
|
<button
|
|
2233
|
-
|
|
2071
|
+
fButton
|
|
2234
2072
|
severity="secondary"
|
|
2235
2073
|
[outlined]="true"
|
|
2236
2074
|
(click)="onCancel()"
|
|
@@ -2238,12 +2076,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2238
2076
|
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
2239
2077
|
</button>
|
|
2240
2078
|
<button
|
|
2241
|
-
|
|
2079
|
+
fButton
|
|
2242
2080
|
type="submit"
|
|
2243
2081
|
[disabled]="!isFormValid() || isSaving()"
|
|
2244
2082
|
>
|
|
2245
2083
|
@if (isSaving()) {
|
|
2246
|
-
<
|
|
2084
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
2247
2085
|
}
|
|
2248
2086
|
<span pButtonLabel>{{
|
|
2249
2087
|
isEditMode()
|
|
@@ -2253,7 +2091,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2253
2091
|
</button>
|
|
2254
2092
|
</div>
|
|
2255
2093
|
</form>
|
|
2256
|
-
</
|
|
2094
|
+
</f-card>
|
|
2257
2095
|
`,
|
|
2258
2096
|
}]
|
|
2259
2097
|
}], ctorParameters: () => [] });
|
|
@@ -2373,7 +2211,7 @@ class TranslationKeyListPage {
|
|
|
2373
2211
|
this.confirmationService.confirm({
|
|
2374
2212
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
2375
2213
|
header: this.translateService.translate('localization.key.delete.title'),
|
|
2376
|
-
icon: '
|
|
2214
|
+
icon: 'exclamation-triangle',
|
|
2377
2215
|
acceptButtonStyleClass: 'p-button-danger',
|
|
2378
2216
|
accept: () => {
|
|
2379
2217
|
from(this.translationKeyService.delete({ id: key.id, type: 'delete' }))
|
|
@@ -2395,8 +2233,8 @@ class TranslationKeyListPage {
|
|
|
2395
2233
|
},
|
|
2396
2234
|
});
|
|
2397
2235
|
}
|
|
2398
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
2399
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
2236
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2237
|
+
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
2238
|
<div class="card">
|
|
2401
2239
|
<div
|
|
2402
2240
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -2411,11 +2249,11 @@ class TranslationKeyListPage {
|
|
|
2411
2249
|
</div>
|
|
2412
2250
|
<div class="flex gap-2">
|
|
2413
2251
|
<button
|
|
2414
|
-
|
|
2252
|
+
fButton
|
|
2415
2253
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2416
2254
|
(click)="onCreate()"
|
|
2417
2255
|
>
|
|
2418
|
-
<
|
|
2256
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2419
2257
|
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2420
2258
|
</button>
|
|
2421
2259
|
</div>
|
|
@@ -2423,7 +2261,7 @@ class TranslationKeyListPage {
|
|
|
2423
2261
|
|
|
2424
2262
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2425
2263
|
<div class="flex-1">
|
|
2426
|
-
<
|
|
2264
|
+
<f-select
|
|
2427
2265
|
[options]="moduleOptions()"
|
|
2428
2266
|
[ngModel]="selectedModule()"
|
|
2429
2267
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2436,28 +2274,27 @@ class TranslationKeyListPage {
|
|
|
2436
2274
|
/>
|
|
2437
2275
|
</div>
|
|
2438
2276
|
<div class="flex-1">
|
|
2439
|
-
<
|
|
2440
|
-
<
|
|
2277
|
+
<f-iconfield class="w-full">
|
|
2278
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2441
2279
|
<input
|
|
2442
|
-
|
|
2280
|
+
fInputText
|
|
2443
2281
|
[ngModel]="searchTerm()"
|
|
2444
2282
|
(ngModelChange)="searchTerm.set($event)"
|
|
2445
2283
|
[ngModelOptions]="{ standalone: true }"
|
|
2446
2284
|
[placeholder]="'shared.search' | translate"
|
|
2447
2285
|
class="w-full"
|
|
2448
2286
|
/>
|
|
2449
|
-
</
|
|
2287
|
+
</f-iconfield>
|
|
2450
2288
|
</div>
|
|
2451
2289
|
</div>
|
|
2452
2290
|
|
|
2453
2291
|
<!-- Table -->
|
|
2454
|
-
<
|
|
2292
|
+
<f-table
|
|
2455
2293
|
[value]="filteredKeys()"
|
|
2456
2294
|
[loading]="isLoading()"
|
|
2457
2295
|
[paginator]="true"
|
|
2458
2296
|
[rows]="15"
|
|
2459
2297
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2460
|
-
class="p-datatable-sm"
|
|
2461
2298
|
>
|
|
2462
2299
|
<ng-template #header>
|
|
2463
2300
|
<tr>
|
|
@@ -2481,7 +2318,7 @@ class TranslationKeyListPage {
|
|
|
2481
2318
|
@let languageCount = languages().length;
|
|
2482
2319
|
<tr>
|
|
2483
2320
|
<td>
|
|
2484
|
-
<
|
|
2321
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2485
2322
|
</td>
|
|
2486
2323
|
<td>
|
|
2487
2324
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2505,26 +2342,26 @@ class TranslationKeyListPage {
|
|
|
2505
2342
|
<td>
|
|
2506
2343
|
<div class="flex gap-1">
|
|
2507
2344
|
<button
|
|
2508
|
-
|
|
2345
|
+
fButton
|
|
2509
2346
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2510
2347
|
[text]="true"
|
|
2511
2348
|
severity="secondary"
|
|
2512
2349
|
size="small"
|
|
2513
|
-
[
|
|
2350
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2514
2351
|
(click)="onEdit(key)"
|
|
2515
2352
|
>
|
|
2516
|
-
<
|
|
2353
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2517
2354
|
</button>
|
|
2518
2355
|
<button
|
|
2519
|
-
|
|
2356
|
+
fButton
|
|
2520
2357
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2521
2358
|
[text]="true"
|
|
2522
2359
|
severity="danger"
|
|
2523
2360
|
size="small"
|
|
2524
|
-
[
|
|
2361
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2525
2362
|
(click)="onDelete(key)"
|
|
2526
2363
|
>
|
|
2527
|
-
<
|
|
2364
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2528
2365
|
</button>
|
|
2529
2366
|
</div>
|
|
2530
2367
|
</td>
|
|
@@ -2537,17 +2374,20 @@ class TranslationKeyListPage {
|
|
|
2537
2374
|
</td>
|
|
2538
2375
|
</tr>
|
|
2539
2376
|
</ng-template>
|
|
2540
|
-
</
|
|
2377
|
+
</f-table>
|
|
2541
2378
|
</div>
|
|
2542
|
-
|
|
2379
|
+
|
|
2380
|
+
<f-confirmdialog />
|
|
2381
|
+
<f-toast />
|
|
2382
|
+
`, 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
2383
|
}
|
|
2544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
2384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyListPage, decorators: [{
|
|
2545
2385
|
type: Component,
|
|
2546
2386
|
args: [{
|
|
2547
2387
|
selector: 'lib-translation-key-list-page',
|
|
2548
2388
|
imports: [
|
|
2549
2389
|
AngularModule,
|
|
2550
|
-
|
|
2390
|
+
UiModule,
|
|
2551
2391
|
FormsModule,
|
|
2552
2392
|
HasPermissionDirective,
|
|
2553
2393
|
TranslatePipe,
|
|
@@ -2567,11 +2407,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2567
2407
|
</div>
|
|
2568
2408
|
<div class="flex gap-2">
|
|
2569
2409
|
<button
|
|
2570
|
-
|
|
2410
|
+
fButton
|
|
2571
2411
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2572
2412
|
(click)="onCreate()"
|
|
2573
2413
|
>
|
|
2574
|
-
<
|
|
2414
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2575
2415
|
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2576
2416
|
</button>
|
|
2577
2417
|
</div>
|
|
@@ -2579,7 +2419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2579
2419
|
|
|
2580
2420
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2581
2421
|
<div class="flex-1">
|
|
2582
|
-
<
|
|
2422
|
+
<f-select
|
|
2583
2423
|
[options]="moduleOptions()"
|
|
2584
2424
|
[ngModel]="selectedModule()"
|
|
2585
2425
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2592,28 +2432,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2592
2432
|
/>
|
|
2593
2433
|
</div>
|
|
2594
2434
|
<div class="flex-1">
|
|
2595
|
-
<
|
|
2596
|
-
<
|
|
2435
|
+
<f-iconfield class="w-full">
|
|
2436
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2597
2437
|
<input
|
|
2598
|
-
|
|
2438
|
+
fInputText
|
|
2599
2439
|
[ngModel]="searchTerm()"
|
|
2600
2440
|
(ngModelChange)="searchTerm.set($event)"
|
|
2601
2441
|
[ngModelOptions]="{ standalone: true }"
|
|
2602
2442
|
[placeholder]="'shared.search' | translate"
|
|
2603
2443
|
class="w-full"
|
|
2604
2444
|
/>
|
|
2605
|
-
</
|
|
2445
|
+
</f-iconfield>
|
|
2606
2446
|
</div>
|
|
2607
2447
|
</div>
|
|
2608
2448
|
|
|
2609
2449
|
<!-- Table -->
|
|
2610
|
-
<
|
|
2450
|
+
<f-table
|
|
2611
2451
|
[value]="filteredKeys()"
|
|
2612
2452
|
[loading]="isLoading()"
|
|
2613
2453
|
[paginator]="true"
|
|
2614
2454
|
[rows]="15"
|
|
2615
2455
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2616
|
-
class="p-datatable-sm"
|
|
2617
2456
|
>
|
|
2618
2457
|
<ng-template #header>
|
|
2619
2458
|
<tr>
|
|
@@ -2637,7 +2476,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2637
2476
|
@let languageCount = languages().length;
|
|
2638
2477
|
<tr>
|
|
2639
2478
|
<td>
|
|
2640
|
-
<
|
|
2479
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2641
2480
|
</td>
|
|
2642
2481
|
<td>
|
|
2643
2482
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2661,26 +2500,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2661
2500
|
<td>
|
|
2662
2501
|
<div class="flex gap-1">
|
|
2663
2502
|
<button
|
|
2664
|
-
|
|
2503
|
+
fButton
|
|
2665
2504
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2666
2505
|
[text]="true"
|
|
2667
2506
|
severity="secondary"
|
|
2668
2507
|
size="small"
|
|
2669
|
-
[
|
|
2508
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2670
2509
|
(click)="onEdit(key)"
|
|
2671
2510
|
>
|
|
2672
|
-
<
|
|
2511
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2673
2512
|
</button>
|
|
2674
2513
|
<button
|
|
2675
|
-
|
|
2514
|
+
fButton
|
|
2676
2515
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2677
2516
|
[text]="true"
|
|
2678
2517
|
severity="danger"
|
|
2679
2518
|
size="small"
|
|
2680
|
-
[
|
|
2519
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2681
2520
|
(click)="onDelete(key)"
|
|
2682
2521
|
>
|
|
2683
|
-
<
|
|
2522
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2684
2523
|
</button>
|
|
2685
2524
|
</div>
|
|
2686
2525
|
</td>
|
|
@@ -2693,8 +2532,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2693
2532
|
</td>
|
|
2694
2533
|
</tr>
|
|
2695
2534
|
</ng-template>
|
|
2696
|
-
</
|
|
2535
|
+
</f-table>
|
|
2697
2536
|
</div>
|
|
2537
|
+
|
|
2538
|
+
<f-confirmdialog />
|
|
2539
|
+
<f-toast />
|
|
2698
2540
|
`,
|
|
2699
2541
|
}]
|
|
2700
2542
|
}] });
|