@flusys/ng-localization 5.4.1 → 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,34 +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 i6 from 'primeng/toast';
|
|
24
|
-
import * as i2$1 from 'primeng/confirmdialog';
|
|
25
|
-
import * as i3$1 from 'primeng/table';
|
|
26
|
-
import * as i4$1 from 'primeng/tag';
|
|
27
|
-
import * as i6$1 from 'primeng/tooltip';
|
|
28
|
-
import * as i7 from 'primeng/textarea';
|
|
29
|
-
import * as i9 from 'primeng/progressspinner';
|
|
30
|
-
import * as i4$2 from 'primeng/iconfield';
|
|
31
|
-
import * as i5$1 from 'primeng/inputicon';
|
|
32
16
|
|
|
33
17
|
const LOCALIZATION_CONFIG = new InjectionToken('LOCALIZATION_CONFIG');
|
|
34
18
|
/** Get localization config with sensible defaults applied */
|
|
@@ -162,10 +146,10 @@ class LanguageApiService extends ApiResourceService {
|
|
|
162
146
|
setDefault(id) {
|
|
163
147
|
return this.http.post(`${this.baseUrl}/set-default`, { id });
|
|
164
148
|
}
|
|
165
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
166
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
167
151
|
}
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageApiService, decorators: [{
|
|
169
153
|
type: Injectable,
|
|
170
154
|
args: [{ providedIn: 'root' }]
|
|
171
155
|
}], ctorParameters: () => [] });
|
|
@@ -182,10 +166,10 @@ class LocalizationApiService {
|
|
|
182
166
|
getTranslationsByLanguage(languageCode, modules) {
|
|
183
167
|
return this.http.post(`${this.baseUrl}/translation/get-by-language`, { languageCode, ...(modules?.length ? { modules } : {}) });
|
|
184
168
|
}
|
|
185
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
186
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
187
171
|
}
|
|
188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationApiService, decorators: [{
|
|
189
173
|
type: Injectable,
|
|
190
174
|
args: [{ providedIn: 'root' }]
|
|
191
175
|
}] });
|
|
@@ -226,10 +210,10 @@ class LocalizationInitializerService {
|
|
|
226
210
|
this.stateService.setLoading(false);
|
|
227
211
|
}
|
|
228
212
|
}
|
|
229
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
230
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
231
215
|
}
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationInitializerService, decorators: [{
|
|
233
217
|
type: Injectable,
|
|
234
218
|
args: [{ providedIn: 'root' }]
|
|
235
219
|
}] });
|
|
@@ -238,18 +222,23 @@ class LocalizationStateService {
|
|
|
238
222
|
platformService = inject(PlatformService);
|
|
239
223
|
document = inject(DOCUMENT);
|
|
240
224
|
appRef = inject(ApplicationRef);
|
|
241
|
-
primeNG = inject(PrimeNG);
|
|
242
225
|
_loadedModules = new Set();
|
|
243
|
-
_currentLanguage = signal(null,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
226
|
+
_currentLanguage = signal(null, /* @ts-ignore */
|
|
227
|
+
...(ngDevMode ? [{ debugName: "_currentLanguage" }] : /* istanbul ignore next */ []));
|
|
228
|
+
_availableLanguages = signal([], /* @ts-ignore */
|
|
229
|
+
...(ngDevMode ? [{ debugName: "_availableLanguages" }] : /* istanbul ignore next */ []));
|
|
230
|
+
_translations = signal({}, /* @ts-ignore */
|
|
231
|
+
...(ngDevMode ? [{ debugName: "_translations" }] : /* istanbul ignore next */ []));
|
|
232
|
+
_fallbackMessages = signal({}, /* @ts-ignore */
|
|
233
|
+
...(ngDevMode ? [{ debugName: "_fallbackMessages" }] : /* istanbul ignore next */ []));
|
|
234
|
+
_isLoading = signal(false, /* @ts-ignore */
|
|
235
|
+
...(ngDevMode ? [{ debugName: "_isLoading" }] : /* istanbul ignore next */ []));
|
|
248
236
|
availableLanguages = this._availableLanguages.asReadonly();
|
|
249
237
|
translations = this._translations.asReadonly();
|
|
250
238
|
fallbackMessages = this._fallbackMessages.asReadonly();
|
|
251
239
|
isLoading = this._isLoading.asReadonly();
|
|
252
|
-
currentLanguageCode = computed(() => this._currentLanguage()?.code ?? 'en',
|
|
240
|
+
currentLanguageCode = computed(() => this._currentLanguage()?.code ?? 'en', /* @ts-ignore */
|
|
241
|
+
...(ngDevMode ? [{ debugName: "currentLanguageCode" }] : /* istanbul ignore next */ []));
|
|
253
242
|
constructor() {
|
|
254
243
|
effect(() => {
|
|
255
244
|
const language = this._currentLanguage();
|
|
@@ -259,86 +248,10 @@ class LocalizationStateService {
|
|
|
259
248
|
localStorage.setItem(STORAGE_KEYS.CURRENT_LANGUAGE, language.code);
|
|
260
249
|
}
|
|
261
250
|
});
|
|
262
|
-
// Trigger zoneless change detection when translations update
|
|
263
251
|
effect(() => {
|
|
264
252
|
this._translations();
|
|
265
253
|
setTimeout(() => this.appRef.tick(), 0);
|
|
266
254
|
});
|
|
267
|
-
effect(() => {
|
|
268
|
-
const translations = this._translations();
|
|
269
|
-
const fallbacks = this._fallbackMessages();
|
|
270
|
-
this.syncPrimeNGTranslations(translations, fallbacks);
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
dotToCamel(str) {
|
|
274
|
-
return str.replace(/\.([a-z])/g, (_, c) => c.toUpperCase());
|
|
275
|
-
}
|
|
276
|
-
PRIMENG_NUMERIC_KEYS = new Set(['firstDayOfWeek']);
|
|
277
|
-
PRIMENG_ARRAY_DEFAULTS = {
|
|
278
|
-
dayNames: [
|
|
279
|
-
'Sunday',
|
|
280
|
-
'Monday',
|
|
281
|
-
'Tuesday',
|
|
282
|
-
'Wednesday',
|
|
283
|
-
'Thursday',
|
|
284
|
-
'Friday',
|
|
285
|
-
'Saturday',
|
|
286
|
-
],
|
|
287
|
-
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
288
|
-
dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
289
|
-
monthNames: [
|
|
290
|
-
'January',
|
|
291
|
-
'February',
|
|
292
|
-
'March',
|
|
293
|
-
'April',
|
|
294
|
-
'May',
|
|
295
|
-
'June',
|
|
296
|
-
'July',
|
|
297
|
-
'August',
|
|
298
|
-
'September',
|
|
299
|
-
'October',
|
|
300
|
-
'November',
|
|
301
|
-
'December',
|
|
302
|
-
],
|
|
303
|
-
monthNamesShort: [
|
|
304
|
-
'Jan',
|
|
305
|
-
'Feb',
|
|
306
|
-
'Mar',
|
|
307
|
-
'Apr',
|
|
308
|
-
'May',
|
|
309
|
-
'Jun',
|
|
310
|
-
'Jul',
|
|
311
|
-
'Aug',
|
|
312
|
-
'Sep',
|
|
313
|
-
'Oct',
|
|
314
|
-
'Nov',
|
|
315
|
-
'Dec',
|
|
316
|
-
],
|
|
317
|
-
};
|
|
318
|
-
syncPrimeNGTranslations(translations, fallbacks) {
|
|
319
|
-
const primeNGTranslations = {
|
|
320
|
-
...this.PRIMENG_ARRAY_DEFAULTS,
|
|
321
|
-
};
|
|
322
|
-
const ariaTranslations = {};
|
|
323
|
-
const prefix = 'primeng.';
|
|
324
|
-
const ariaPrefix = 'primeng.aria.';
|
|
325
|
-
const allMessages = { ...fallbacks, ...translations };
|
|
326
|
-
for (const [key, value] of Object.entries(allMessages)) {
|
|
327
|
-
if (key.startsWith(ariaPrefix)) {
|
|
328
|
-
const ariaKey = this.dotToCamel(key.substring(ariaPrefix.length));
|
|
329
|
-
ariaTranslations[ariaKey] = value;
|
|
330
|
-
}
|
|
331
|
-
else if (key.startsWith(prefix)) {
|
|
332
|
-
const primeKey = this.dotToCamel(key.substring(prefix.length));
|
|
333
|
-
primeNGTranslations[primeKey] = this.PRIMENG_NUMERIC_KEYS.has(primeKey)
|
|
334
|
-
? parseInt(value, 10)
|
|
335
|
-
: value;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
if (Object.keys(ariaTranslations).length > 0) {
|
|
339
|
-
primeNGTranslations['aria'] = ariaTranslations;
|
|
340
|
-
}
|
|
341
|
-
this.primeNG.setTranslation(primeNGTranslations);
|
|
342
255
|
}
|
|
343
256
|
setCurrentLanguage(language) {
|
|
344
257
|
this._currentLanguage.set(language);
|
|
@@ -375,10 +288,10 @@ class LocalizationStateService {
|
|
|
375
288
|
updateFallbackMessages(messages) {
|
|
376
289
|
this._fallbackMessages.update((current) => ({ ...current, ...messages }));
|
|
377
290
|
}
|
|
378
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
379
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
380
293
|
}
|
|
381
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationStateService, decorators: [{
|
|
382
295
|
type: Injectable,
|
|
383
296
|
args: [{ providedIn: 'root' }]
|
|
384
297
|
}], ctorParameters: () => [] });
|
|
@@ -400,10 +313,10 @@ class TranslationApiService extends ApiResourceService {
|
|
|
400
313
|
bulkUpdate(translations) {
|
|
401
314
|
return this.http.post(`${this.baseUrl}/update-many-values`, { translations });
|
|
402
315
|
}
|
|
403
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
404
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
405
318
|
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationApiService, decorators: [{
|
|
407
320
|
type: Injectable,
|
|
408
321
|
args: [{ providedIn: 'root' }]
|
|
409
322
|
}], ctorParameters: () => [] });
|
|
@@ -415,10 +328,10 @@ class TranslationKeyApiService extends ApiResourceService {
|
|
|
415
328
|
getModules() {
|
|
416
329
|
return this.http.post(`${this.baseUrl}/get-modules`, {});
|
|
417
330
|
}
|
|
418
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
419
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
420
333
|
}
|
|
421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyApiService, decorators: [{
|
|
422
335
|
type: Injectable,
|
|
423
336
|
args: [{ providedIn: 'root' }]
|
|
424
337
|
}], ctorParameters: () => [] });
|
|
@@ -482,10 +395,10 @@ class TranslationLoaderService {
|
|
|
482
395
|
loadTranslationsAsync(languageCode, clearModules = false) {
|
|
483
396
|
return from(this.loadTranslations(languageCode, clearModules));
|
|
484
397
|
}
|
|
485
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
486
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
487
400
|
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationLoaderService, decorators: [{
|
|
489
402
|
type: Injectable,
|
|
490
403
|
args: [{ providedIn: 'root' }]
|
|
491
404
|
}] });
|
|
@@ -494,127 +407,75 @@ class LanguageSelectorComponent {
|
|
|
494
407
|
localizationState = inject(LocalizationStateService);
|
|
495
408
|
translationLoader = inject(TranslationLoaderService);
|
|
496
409
|
destroyRef = inject(DestroyRef);
|
|
497
|
-
document = inject(DOCUMENT);
|
|
498
|
-
elementRef = inject(ElementRef);
|
|
499
410
|
languages = this.localizationState.availableLanguages;
|
|
500
|
-
_isActive = signal(false, ...(ngDevMode ? [{ debugName: "_isActive" }] : []));
|
|
501
|
-
isActive = this._isActive.asReadonly();
|
|
502
411
|
selectedLanguageCode = this.localizationState.currentLanguageCode;
|
|
503
|
-
selectedLanguage = computed(() => this.languages().find((l) => l.code === this.selectedLanguageCode()) ?? null,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
togglePanel() {
|
|
515
|
-
this._isActive.update((v) => !v);
|
|
516
|
-
}
|
|
412
|
+
selectedLanguage = computed(() => this.languages().find((l) => l.code === this.selectedLanguageCode()) ?? null, /* @ts-ignore */
|
|
413
|
+
...(ngDevMode ? [{ debugName: "selectedLanguage" }] : /* istanbul ignore next */ []));
|
|
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 */ []));
|
|
517
421
|
onLanguageSelect(code) {
|
|
518
422
|
const language = this.languages().find((l) => l.code === code);
|
|
519
423
|
if (language) {
|
|
520
424
|
this.localizationState.setCurrentLanguage(language);
|
|
521
|
-
this._isActive.set(false);
|
|
522
425
|
this.translationLoader
|
|
523
426
|
.loadTranslationsAsync(code, true)
|
|
524
427
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
525
428
|
.subscribe();
|
|
526
429
|
}
|
|
527
430
|
}
|
|
528
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
529
|
-
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: `
|
|
530
433
|
<button
|
|
531
434
|
type="button"
|
|
532
435
|
class="layout-topbar-action"
|
|
533
|
-
[class.layout-topbar-action-highlight]="
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
enterActiveClass="animate-scalein"
|
|
537
|
-
leaveToClass="hidden"
|
|
538
|
-
leaveActiveClass="animate-fadeout"
|
|
539
|
-
[hideOnOutsideClick]="true"
|
|
540
|
-
(click)="togglePanel()">
|
|
541
|
-
<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>
|
|
542
439
|
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
543
440
|
</button>
|
|
544
|
-
<
|
|
545
|
-
|
|
546
|
-
style="background-color: var(--surface-overlay); inset-inline-end: 0;">
|
|
547
|
-
<div class="flex flex-col">
|
|
548
|
-
@for (lang of languages(); track lang.id) {
|
|
549
|
-
<button
|
|
550
|
-
type="button"
|
|
551
|
-
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"
|
|
552
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
553
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
554
|
-
(click)="onLanguageSelect(lang.code)">
|
|
555
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
556
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
557
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
558
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
559
|
-
}
|
|
560
|
-
</button>
|
|
561
|
-
}
|
|
562
|
-
</div>
|
|
563
|
-
</div>
|
|
564
|
-
`, 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"] }] });
|
|
565
443
|
}
|
|
566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
|
|
567
445
|
type: Component,
|
|
568
446
|
args: [{
|
|
569
447
|
selector: 'lib-language-selector',
|
|
570
|
-
imports: [
|
|
448
|
+
imports: [UiModule],
|
|
571
449
|
host: { class: 'relative' },
|
|
572
450
|
template: `
|
|
573
451
|
<button
|
|
574
452
|
type="button"
|
|
575
453
|
class="layout-topbar-action"
|
|
576
|
-
[class.layout-topbar-action-highlight]="
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
enterActiveClass="animate-scalein"
|
|
580
|
-
leaveToClass="hidden"
|
|
581
|
-
leaveActiveClass="animate-fadeout"
|
|
582
|
-
[hideOnOutsideClick]="true"
|
|
583
|
-
(click)="togglePanel()">
|
|
584
|
-
<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>
|
|
585
457
|
<span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
|
|
586
458
|
</button>
|
|
587
|
-
<
|
|
588
|
-
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]"
|
|
589
|
-
style="background-color: var(--surface-overlay); inset-inline-end: 0;">
|
|
590
|
-
<div class="flex flex-col">
|
|
591
|
-
@for (lang of languages(); track lang.id) {
|
|
592
|
-
<button
|
|
593
|
-
type="button"
|
|
594
|
-
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"
|
|
595
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
596
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
597
|
-
(click)="onLanguageSelect(lang.code)">
|
|
598
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
599
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
600
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
601
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
602
|
-
}
|
|
603
|
-
</button>
|
|
604
|
-
}
|
|
605
|
-
</div>
|
|
606
|
-
</div>
|
|
459
|
+
<f-menu #menu [model]="menuItems()" [popup]="true" class="absolute top-[3.25rem]" style="inset-inline-end: 0;" />
|
|
607
460
|
`,
|
|
608
461
|
}]
|
|
609
|
-
}]
|
|
462
|
+
}] });
|
|
610
463
|
|
|
611
464
|
class LanguageSelectorPanelComponent {
|
|
612
465
|
localizationState = inject(LocalizationStateService);
|
|
613
466
|
translationLoader = inject(TranslationLoaderService);
|
|
614
467
|
destroyRef = inject(DestroyRef);
|
|
615
468
|
languages = this.localizationState.availableLanguages;
|
|
616
|
-
_selectedLanguageCode = signal(this.localizationState.currentLanguageCode(),
|
|
469
|
+
_selectedLanguageCode = signal(this.localizationState.currentLanguageCode(), /* @ts-ignore */
|
|
470
|
+
...(ngDevMode ? [{ debugName: "_selectedLanguageCode" }] : /* istanbul ignore next */ []));
|
|
617
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 */ []));
|
|
618
479
|
constructor() {
|
|
619
480
|
effect(() => {
|
|
620
481
|
const currentCode = this.localizationState.currentLanguageCode();
|
|
@@ -634,53 +495,19 @@ class LanguageSelectorPanelComponent {
|
|
|
634
495
|
.subscribe();
|
|
635
496
|
}
|
|
636
497
|
}
|
|
637
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
638
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
639
|
-
<div class="flex flex-col">
|
|
640
|
-
@for (lang of languages(); track lang.id) {
|
|
641
|
-
<button
|
|
642
|
-
type="button"
|
|
643
|
-
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"
|
|
644
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
645
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
646
|
-
(click)="onLanguageSelect(lang.code)">
|
|
647
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
648
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
649
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
650
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
651
|
-
}
|
|
652
|
-
</button>
|
|
653
|
-
}
|
|
654
|
-
</div>
|
|
655
|
-
`, 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"] }] });
|
|
656
500
|
}
|
|
657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageSelectorPanelComponent, decorators: [{
|
|
658
502
|
type: Component,
|
|
659
503
|
args: [{
|
|
660
504
|
selector: 'lib-language-selector-panel',
|
|
661
|
-
imports: [],
|
|
505
|
+
imports: [MenuComponent],
|
|
662
506
|
host: {
|
|
663
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]',
|
|
664
508
|
style: 'background-color: var(--surface-overlay); inset-inline-end: 0;',
|
|
665
509
|
},
|
|
666
|
-
template:
|
|
667
|
-
<div class="flex flex-col">
|
|
668
|
-
@for (lang of languages(); track lang.id) {
|
|
669
|
-
<button
|
|
670
|
-
type="button"
|
|
671
|
-
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"
|
|
672
|
-
[class.bg-primary-50]="lang.code === selectedLanguageCode()"
|
|
673
|
-
[class.text-primary]="lang.code === selectedLanguageCode()"
|
|
674
|
-
(click)="onLanguageSelect(lang.code)">
|
|
675
|
-
<span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
|
|
676
|
-
<span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
|
|
677
|
-
@if (lang.code === selectedLanguageCode()) {
|
|
678
|
-
<i class="pi pi-check text-primary text-sm"></i>
|
|
679
|
-
}
|
|
680
|
-
</button>
|
|
681
|
-
}
|
|
682
|
-
</div>
|
|
683
|
-
`,
|
|
510
|
+
template: `<f-menu [model]="menuItems()" />`,
|
|
684
511
|
}]
|
|
685
512
|
}], ctorParameters: () => [] });
|
|
686
513
|
|
|
@@ -724,9 +551,12 @@ class LanguageFormPage {
|
|
|
724
551
|
destroyRef = inject(DestroyRef);
|
|
725
552
|
routeParams = toSignal(this.route.paramMap);
|
|
726
553
|
loadTriggered = false;
|
|
727
|
-
isSaving = signal(false,
|
|
728
|
-
|
|
729
|
-
|
|
554
|
+
isSaving = signal(false, /* @ts-ignore */
|
|
555
|
+
...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
556
|
+
existingLanguage = signal(null, /* @ts-ignore */
|
|
557
|
+
...(ngDevMode ? [{ debugName: "existingLanguage" }] : /* istanbul ignore next */ []));
|
|
558
|
+
isEditMode = computed(() => !!this.existingLanguage(), /* @ts-ignore */
|
|
559
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
730
560
|
translate(key, vars) {
|
|
731
561
|
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
732
562
|
}
|
|
@@ -739,7 +569,8 @@ class LanguageFormPage {
|
|
|
739
569
|
label: this.translate('localization.language.direction.rtl'),
|
|
740
570
|
value: 'rtl',
|
|
741
571
|
},
|
|
742
|
-
],
|
|
572
|
+
], /* @ts-ignore */
|
|
573
|
+
...(ngDevMode ? [{ debugName: "directionOptions" }] : /* istanbul ignore next */ []));
|
|
743
574
|
formModel = signal({
|
|
744
575
|
code: '',
|
|
745
576
|
name: '',
|
|
@@ -748,7 +579,8 @@ class LanguageFormPage {
|
|
|
748
579
|
serial: '',
|
|
749
580
|
isActive: true,
|
|
750
581
|
isDefault: false,
|
|
751
|
-
},
|
|
582
|
+
}, /* @ts-ignore */
|
|
583
|
+
...(ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []));
|
|
752
584
|
formTree = form(this.formModel, (f) => {
|
|
753
585
|
required(f.code, {
|
|
754
586
|
message: this.translate('localization.validation.code.required'),
|
|
@@ -766,7 +598,8 @@ class LanguageFormPage {
|
|
|
766
598
|
isFormValid = computed(() => {
|
|
767
599
|
const model = this.formModel();
|
|
768
600
|
return model.code.trim().length > 0 && model.name.trim().length > 0;
|
|
769
|
-
},
|
|
601
|
+
}, /* @ts-ignore */
|
|
602
|
+
...(ngDevMode ? [{ debugName: "isFormValid" }] : /* istanbul ignore next */ []));
|
|
770
603
|
constructor() {
|
|
771
604
|
effect(() => {
|
|
772
605
|
const params = this.routeParams();
|
|
@@ -847,9 +680,9 @@ class LanguageFormPage {
|
|
|
847
680
|
onCancel() {
|
|
848
681
|
this.router.navigate(['/localization/languages']);
|
|
849
682
|
}
|
|
850
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
851
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
852
|
-
<
|
|
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>
|
|
853
686
|
<ng-template #header>
|
|
854
687
|
<div class="flex justify-between items-center p-4">
|
|
855
688
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -872,7 +705,7 @@ class LanguageFormPage {
|
|
|
872
705
|
>{{ 'localization.language.code' | translate }} *</label
|
|
873
706
|
>
|
|
874
707
|
<input
|
|
875
|
-
|
|
708
|
+
fInputText
|
|
876
709
|
id="code"
|
|
877
710
|
[formField]="formTree.code"
|
|
878
711
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -888,7 +721,7 @@ class LanguageFormPage {
|
|
|
888
721
|
>{{ 'localization.language.name' | translate }} *</label
|
|
889
722
|
>
|
|
890
723
|
<input
|
|
891
|
-
|
|
724
|
+
fInputText
|
|
892
725
|
id="name"
|
|
893
726
|
[formField]="formTree.name"
|
|
894
727
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -901,7 +734,7 @@ class LanguageFormPage {
|
|
|
901
734
|
'localization.language.native.name' | translate
|
|
902
735
|
}}</label>
|
|
903
736
|
<input
|
|
904
|
-
|
|
737
|
+
fInputText
|
|
905
738
|
id="nativeName"
|
|
906
739
|
[formField]="formTree.nativeName"
|
|
907
740
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -916,7 +749,7 @@ class LanguageFormPage {
|
|
|
916
749
|
<label for="direction" class="font-medium"
|
|
917
750
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
918
751
|
>
|
|
919
|
-
<
|
|
752
|
+
<f-select
|
|
920
753
|
id="direction"
|
|
921
754
|
[ngModel]="formModel().direction"
|
|
922
755
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -934,7 +767,7 @@ class LanguageFormPage {
|
|
|
934
767
|
'localization.language.display.order' | translate
|
|
935
768
|
}}</label>
|
|
936
769
|
<input
|
|
937
|
-
|
|
770
|
+
fInputText
|
|
938
771
|
id="serial"
|
|
939
772
|
type="number"
|
|
940
773
|
[formField]="formTree.serial"
|
|
@@ -947,49 +780,47 @@ class LanguageFormPage {
|
|
|
947
780
|
|
|
948
781
|
<!-- Checkboxes -->
|
|
949
782
|
<div class="flex items-center gap-6 md:col-span-2 pt-4">
|
|
950
|
-
<
|
|
951
|
-
|
|
952
|
-
<span>{{ 'shared.active' | translate }}</span>
|
|
953
|
-
</label>
|
|
954
|
-
<label class="p-checkbox-native">
|
|
955
|
-
<input type="checkbox" [formField]="formTree.isDefault" />
|
|
956
|
-
<span>{{ 'localization.language.default' | translate }}</span>
|
|
957
|
-
</label>
|
|
783
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
784
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
958
785
|
</div>
|
|
959
786
|
|
|
960
787
|
<!-- Actions -->
|
|
961
788
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
962
|
-
<
|
|
963
|
-
|
|
789
|
+
<button
|
|
790
|
+
fButton
|
|
964
791
|
severity="secondary"
|
|
965
792
|
[outlined]="true"
|
|
966
|
-
(
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
793
|
+
(click)="onCancel()"
|
|
794
|
+
>
|
|
795
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
796
|
+
</button>
|
|
797
|
+
<button
|
|
798
|
+
fButton
|
|
799
|
+
type="submit"
|
|
800
|
+
[disabled]="!isFormValid() || isSaving()"
|
|
801
|
+
>
|
|
802
|
+
@if (isSaving()) {
|
|
803
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
804
|
+
}
|
|
805
|
+
<span pButtonLabel>{{
|
|
970
806
|
isEditMode()
|
|
971
807
|
? ('shared.update' | translate)
|
|
972
808
|
: ('shared.create' | translate)
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
[loading]="isSaving()"
|
|
976
|
-
[disabled]="!isFormValid() || isSaving()"
|
|
977
|
-
/>
|
|
809
|
+
}}</span>
|
|
810
|
+
</button>
|
|
978
811
|
</div>
|
|
979
812
|
</form>
|
|
980
|
-
</
|
|
981
|
-
|
|
982
|
-
<p-toast />
|
|
983
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i5.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i6.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
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" }] });
|
|
984
815
|
}
|
|
985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageFormPage, decorators: [{
|
|
986
817
|
type: Component,
|
|
987
818
|
args: [{
|
|
988
819
|
selector: 'lib-language-form-page',
|
|
989
|
-
imports: [
|
|
820
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
990
821
|
providers: [MessageService],
|
|
991
822
|
template: `
|
|
992
|
-
<
|
|
823
|
+
<f-card>
|
|
993
824
|
<ng-template #header>
|
|
994
825
|
<div class="flex justify-between items-center p-4">
|
|
995
826
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1012,7 +843,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1012
843
|
>{{ 'localization.language.code' | translate }} *</label
|
|
1013
844
|
>
|
|
1014
845
|
<input
|
|
1015
|
-
|
|
846
|
+
fInputText
|
|
1016
847
|
id="code"
|
|
1017
848
|
[formField]="formTree.code"
|
|
1018
849
|
[placeholder]="'localization.placeholder.code' | translate"
|
|
@@ -1028,7 +859,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1028
859
|
>{{ 'localization.language.name' | translate }} *</label
|
|
1029
860
|
>
|
|
1030
861
|
<input
|
|
1031
|
-
|
|
862
|
+
fInputText
|
|
1032
863
|
id="name"
|
|
1033
864
|
[formField]="formTree.name"
|
|
1034
865
|
[placeholder]="'localization.placeholder.name' | translate"
|
|
@@ -1041,7 +872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1041
872
|
'localization.language.native.name' | translate
|
|
1042
873
|
}}</label>
|
|
1043
874
|
<input
|
|
1044
|
-
|
|
875
|
+
fInputText
|
|
1045
876
|
id="nativeName"
|
|
1046
877
|
[formField]="formTree.nativeName"
|
|
1047
878
|
[placeholder]="'localization.placeholder.native.name' | translate"
|
|
@@ -1056,7 +887,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1056
887
|
<label for="direction" class="font-medium"
|
|
1057
888
|
>{{ 'localization.language.direction' | translate }} *</label
|
|
1058
889
|
>
|
|
1059
|
-
<
|
|
890
|
+
<f-select
|
|
1060
891
|
id="direction"
|
|
1061
892
|
[ngModel]="formModel().direction"
|
|
1062
893
|
(ngModelChange)="updateDirection($event)"
|
|
@@ -1074,7 +905,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1074
905
|
'localization.language.display.order' | translate
|
|
1075
906
|
}}</label>
|
|
1076
907
|
<input
|
|
1077
|
-
|
|
908
|
+
fInputText
|
|
1078
909
|
id="serial"
|
|
1079
910
|
type="number"
|
|
1080
911
|
[formField]="formTree.serial"
|
|
@@ -1087,39 +918,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1087
918
|
|
|
1088
919
|
<!-- Checkboxes -->
|
|
1089
920
|
<div class="flex items-center gap-6 md:col-span-2 pt-4">
|
|
1090
|
-
<
|
|
1091
|
-
|
|
1092
|
-
<span>{{ 'shared.active' | translate }}</span>
|
|
1093
|
-
</label>
|
|
1094
|
-
<label class="p-checkbox-native">
|
|
1095
|
-
<input type="checkbox" [formField]="formTree.isDefault" />
|
|
1096
|
-
<span>{{ 'localization.language.default' | translate }}</span>
|
|
1097
|
-
</label>
|
|
921
|
+
<f-checkbox [formField]="formTree.isActive" [label]="'shared.active' | translate" />
|
|
922
|
+
<f-checkbox [formField]="formTree.isDefault" [label]="'localization.language.default' | translate" />
|
|
1098
923
|
</div>
|
|
1099
924
|
|
|
1100
925
|
<!-- Actions -->
|
|
1101
926
|
<div class="flex justify-end gap-4 md:col-span-2 pt-4">
|
|
1102
|
-
<
|
|
1103
|
-
|
|
927
|
+
<button
|
|
928
|
+
fButton
|
|
1104
929
|
severity="secondary"
|
|
1105
930
|
[outlined]="true"
|
|
1106
|
-
(
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
931
|
+
(click)="onCancel()"
|
|
932
|
+
>
|
|
933
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
934
|
+
</button>
|
|
935
|
+
<button
|
|
936
|
+
fButton
|
|
937
|
+
type="submit"
|
|
938
|
+
[disabled]="!isFormValid() || isSaving()"
|
|
939
|
+
>
|
|
940
|
+
@if (isSaving()) {
|
|
941
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
942
|
+
}
|
|
943
|
+
<span pButtonLabel>{{
|
|
1110
944
|
isEditMode()
|
|
1111
945
|
? ('shared.update' | translate)
|
|
1112
946
|
: ('shared.create' | translate)
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
[loading]="isSaving()"
|
|
1116
|
-
[disabled]="!isFormValid() || isSaving()"
|
|
1117
|
-
/>
|
|
947
|
+
}}</span>
|
|
948
|
+
</button>
|
|
1118
949
|
</div>
|
|
1119
950
|
</form>
|
|
1120
|
-
</
|
|
1121
|
-
|
|
1122
|
-
<p-toast />
|
|
951
|
+
</f-card>
|
|
1123
952
|
`,
|
|
1124
953
|
}]
|
|
1125
954
|
}], ctorParameters: () => [] });
|
|
@@ -1154,7 +983,7 @@ class LanguageListPage {
|
|
|
1154
983
|
this.confirmationService.confirm({
|
|
1155
984
|
message: this.translateService.translate('localization.language.confirm.set.default', { name: lang.name }),
|
|
1156
985
|
header: this.translateService.translate('localization.language.set.default'),
|
|
1157
|
-
icon: '
|
|
986
|
+
icon: 'star',
|
|
1158
987
|
accept: () => {
|
|
1159
988
|
this.languageService
|
|
1160
989
|
.setDefault(lang.id)
|
|
@@ -1180,7 +1009,7 @@ class LanguageListPage {
|
|
|
1180
1009
|
this.confirmationService.confirm({
|
|
1181
1010
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
1182
1011
|
header: this.translateService.translate('localization.language.delete.title'),
|
|
1183
|
-
icon: '
|
|
1012
|
+
icon: 'exclamation-triangle',
|
|
1184
1013
|
acceptButtonStyleClass: 'p-button-danger',
|
|
1185
1014
|
accept: () => {
|
|
1186
1015
|
from(this.languageService.delete({ id: lang.id, type: 'delete' }))
|
|
@@ -1202,8 +1031,8 @@ class LanguageListPage {
|
|
|
1202
1031
|
},
|
|
1203
1032
|
});
|
|
1204
1033
|
}
|
|
1205
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1206
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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: `
|
|
1207
1036
|
<div class="card">
|
|
1208
1037
|
<div
|
|
1209
1038
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -1216,20 +1045,21 @@ class LanguageListPage {
|
|
|
1216
1045
|
{{ 'localization.language.subtitle' | translate }}
|
|
1217
1046
|
</p>
|
|
1218
1047
|
</div>
|
|
1219
|
-
<
|
|
1048
|
+
<button
|
|
1049
|
+
fButton
|
|
1220
1050
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1051
|
+
(click)="onCreate()"
|
|
1052
|
+
class="w-full sm:w-auto"
|
|
1053
|
+
>
|
|
1054
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1055
|
+
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1056
|
+
</button>
|
|
1226
1057
|
</div>
|
|
1227
1058
|
|
|
1228
1059
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1229
|
-
<
|
|
1060
|
+
<f-table
|
|
1230
1061
|
[value]="languageService.data()"
|
|
1231
1062
|
[loading]="languageService.isLoading()"
|
|
1232
|
-
styleClass="p-datatable-sm"
|
|
1233
1063
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1234
1064
|
>
|
|
1235
1065
|
<ng-template #header>
|
|
@@ -1251,7 +1081,7 @@ class LanguageListPage {
|
|
|
1251
1081
|
<td>{{ lang.name }}</td>
|
|
1252
1082
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1253
1083
|
<td>
|
|
1254
|
-
<
|
|
1084
|
+
<f-tag
|
|
1255
1085
|
[value]="
|
|
1256
1086
|
lang.direction === 'rtl'
|
|
1257
1087
|
? ('localization.language.rtl' | translate)
|
|
@@ -1262,7 +1092,7 @@ class LanguageListPage {
|
|
|
1262
1092
|
</td>
|
|
1263
1093
|
<td>
|
|
1264
1094
|
<div class="flex gap-1 items-center">
|
|
1265
|
-
<
|
|
1095
|
+
<f-tag
|
|
1266
1096
|
[value]="
|
|
1267
1097
|
lang.isActive
|
|
1268
1098
|
? ('shared.active' | translate)
|
|
@@ -1271,7 +1101,7 @@ class LanguageListPage {
|
|
|
1271
1101
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1272
1102
|
/>
|
|
1273
1103
|
@if (lang.isDefault) {
|
|
1274
|
-
<
|
|
1104
|
+
<f-tag
|
|
1275
1105
|
[value]="'localization.language.default' | translate"
|
|
1276
1106
|
severity="contrast"
|
|
1277
1107
|
/>
|
|
@@ -1281,36 +1111,42 @@ class LanguageListPage {
|
|
|
1281
1111
|
<td>
|
|
1282
1112
|
<div class="flex gap-1">
|
|
1283
1113
|
@if (!lang.isDefault) {
|
|
1284
|
-
<
|
|
1114
|
+
<button
|
|
1115
|
+
fButton
|
|
1285
1116
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1286
|
-
icon="pi pi-star"
|
|
1287
1117
|
[text]="true"
|
|
1288
1118
|
size="small"
|
|
1289
|
-
[
|
|
1119
|
+
[fTooltip]="
|
|
1290
1120
|
'localization.language.set.default' | translate
|
|
1291
1121
|
"
|
|
1292
|
-
(
|
|
1293
|
-
|
|
1122
|
+
(click)="onSetDefault(lang)"
|
|
1123
|
+
>
|
|
1124
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1125
|
+
</button>
|
|
1294
1126
|
}
|
|
1295
|
-
<
|
|
1127
|
+
<button
|
|
1128
|
+
fButton
|
|
1296
1129
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1297
|
-
icon="pi pi-pencil"
|
|
1298
1130
|
[text]="true"
|
|
1299
1131
|
severity="secondary"
|
|
1300
1132
|
size="small"
|
|
1301
|
-
[
|
|
1302
|
-
(
|
|
1303
|
-
|
|
1304
|
-
|
|
1133
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1134
|
+
(click)="onEdit(lang.id)"
|
|
1135
|
+
>
|
|
1136
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1137
|
+
</button>
|
|
1138
|
+
<button
|
|
1139
|
+
fButton
|
|
1305
1140
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1306
|
-
icon="pi pi-trash"
|
|
1307
1141
|
[text]="true"
|
|
1308
1142
|
severity="danger"
|
|
1309
1143
|
size="small"
|
|
1310
|
-
[
|
|
1144
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1311
1145
|
[disabled]="lang.isDefault"
|
|
1312
|
-
(
|
|
1313
|
-
|
|
1146
|
+
(click)="onDelete(lang)"
|
|
1147
|
+
>
|
|
1148
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1149
|
+
</button>
|
|
1314
1150
|
</div>
|
|
1315
1151
|
</td>
|
|
1316
1152
|
</tr>
|
|
@@ -1323,19 +1159,19 @@ class LanguageListPage {
|
|
|
1323
1159
|
</td>
|
|
1324
1160
|
</tr>
|
|
1325
1161
|
</ng-template>
|
|
1326
|
-
</
|
|
1162
|
+
</f-table>
|
|
1327
1163
|
</div>
|
|
1328
1164
|
</div>
|
|
1329
1165
|
|
|
1330
|
-
<
|
|
1331
|
-
<
|
|
1332
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type:
|
|
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" }] });
|
|
1333
1169
|
}
|
|
1334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LanguageListPage, decorators: [{
|
|
1335
1171
|
type: Component,
|
|
1336
1172
|
args: [{
|
|
1337
1173
|
selector: 'lib-language-list-page',
|
|
1338
|
-
imports: [AngularModule,
|
|
1174
|
+
imports: [AngularModule, UiModule, HasPermissionDirective, TranslatePipe],
|
|
1339
1175
|
providers: [ConfirmationService, MessageService],
|
|
1340
1176
|
template: `
|
|
1341
1177
|
<div class="card">
|
|
@@ -1350,20 +1186,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1350
1186
|
{{ 'localization.language.subtitle' | translate }}
|
|
1351
1187
|
</p>
|
|
1352
1188
|
</div>
|
|
1353
|
-
<
|
|
1189
|
+
<button
|
|
1190
|
+
fButton
|
|
1354
1191
|
*hasPermission="LANGUAGE_PERMISSIONS.CREATE"
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1192
|
+
(click)="onCreate()"
|
|
1193
|
+
class="w-full sm:w-auto"
|
|
1194
|
+
>
|
|
1195
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
1196
|
+
<span pButtonLabel>{{ 'localization.language.new' | translate }}</span>
|
|
1197
|
+
</button>
|
|
1360
1198
|
</div>
|
|
1361
1199
|
|
|
1362
1200
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
1363
|
-
<
|
|
1201
|
+
<f-table
|
|
1364
1202
|
[value]="languageService.data()"
|
|
1365
1203
|
[loading]="languageService.isLoading()"
|
|
1366
|
-
styleClass="p-datatable-sm"
|
|
1367
1204
|
[tableStyle]="{ 'min-width': '40rem' }"
|
|
1368
1205
|
>
|
|
1369
1206
|
<ng-template #header>
|
|
@@ -1385,7 +1222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1385
1222
|
<td>{{ lang.name }}</td>
|
|
1386
1223
|
<td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
|
|
1387
1224
|
<td>
|
|
1388
|
-
<
|
|
1225
|
+
<f-tag
|
|
1389
1226
|
[value]="
|
|
1390
1227
|
lang.direction === 'rtl'
|
|
1391
1228
|
? ('localization.language.rtl' | translate)
|
|
@@ -1396,7 +1233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1396
1233
|
</td>
|
|
1397
1234
|
<td>
|
|
1398
1235
|
<div class="flex gap-1 items-center">
|
|
1399
|
-
<
|
|
1236
|
+
<f-tag
|
|
1400
1237
|
[value]="
|
|
1401
1238
|
lang.isActive
|
|
1402
1239
|
? ('shared.active' | translate)
|
|
@@ -1405,7 +1242,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1405
1242
|
[severity]="lang.isActive ? 'success' : 'secondary'"
|
|
1406
1243
|
/>
|
|
1407
1244
|
@if (lang.isDefault) {
|
|
1408
|
-
<
|
|
1245
|
+
<f-tag
|
|
1409
1246
|
[value]="'localization.language.default' | translate"
|
|
1410
1247
|
severity="contrast"
|
|
1411
1248
|
/>
|
|
@@ -1415,36 +1252,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1415
1252
|
<td>
|
|
1416
1253
|
<div class="flex gap-1">
|
|
1417
1254
|
@if (!lang.isDefault) {
|
|
1418
|
-
<
|
|
1255
|
+
<button
|
|
1256
|
+
fButton
|
|
1419
1257
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1420
|
-
icon="pi pi-star"
|
|
1421
1258
|
[text]="true"
|
|
1422
1259
|
size="small"
|
|
1423
|
-
[
|
|
1260
|
+
[fTooltip]="
|
|
1424
1261
|
'localization.language.set.default' | translate
|
|
1425
1262
|
"
|
|
1426
|
-
(
|
|
1427
|
-
|
|
1263
|
+
(click)="onSetDefault(lang)"
|
|
1264
|
+
>
|
|
1265
|
+
<ui-icon pButtonIcon name="star"></ui-icon>
|
|
1266
|
+
</button>
|
|
1428
1267
|
}
|
|
1429
|
-
<
|
|
1268
|
+
<button
|
|
1269
|
+
fButton
|
|
1430
1270
|
*hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
|
|
1431
|
-
icon="pi pi-pencil"
|
|
1432
1271
|
[text]="true"
|
|
1433
1272
|
severity="secondary"
|
|
1434
1273
|
size="small"
|
|
1435
|
-
[
|
|
1436
|
-
(
|
|
1437
|
-
|
|
1438
|
-
|
|
1274
|
+
[fTooltip]="'shared.edit' | translate"
|
|
1275
|
+
(click)="onEdit(lang.id)"
|
|
1276
|
+
>
|
|
1277
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
1278
|
+
</button>
|
|
1279
|
+
<button
|
|
1280
|
+
fButton
|
|
1439
1281
|
*hasPermission="LANGUAGE_PERMISSIONS.DELETE"
|
|
1440
|
-
icon="pi pi-trash"
|
|
1441
1282
|
[text]="true"
|
|
1442
1283
|
severity="danger"
|
|
1443
1284
|
size="small"
|
|
1444
|
-
[
|
|
1285
|
+
[fTooltip]="'shared.delete' | translate"
|
|
1445
1286
|
[disabled]="lang.isDefault"
|
|
1446
|
-
(
|
|
1447
|
-
|
|
1287
|
+
(click)="onDelete(lang)"
|
|
1288
|
+
>
|
|
1289
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
1290
|
+
</button>
|
|
1448
1291
|
</div>
|
|
1449
1292
|
</td>
|
|
1450
1293
|
</tr>
|
|
@@ -1457,12 +1300,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1457
1300
|
</td>
|
|
1458
1301
|
</tr>
|
|
1459
1302
|
</ng-template>
|
|
1460
|
-
</
|
|
1303
|
+
</f-table>
|
|
1461
1304
|
</div>
|
|
1462
1305
|
</div>
|
|
1463
1306
|
|
|
1464
|
-
<
|
|
1465
|
-
<
|
|
1307
|
+
<f-confirmdialog />
|
|
1308
|
+
<f-toast />
|
|
1466
1309
|
`,
|
|
1467
1310
|
}]
|
|
1468
1311
|
}] });
|
|
@@ -1478,14 +1321,14 @@ class LocalizationContainerPage {
|
|
|
1478
1321
|
{
|
|
1479
1322
|
id: 'languages',
|
|
1480
1323
|
labelKey: 'localization.tabs.languages',
|
|
1481
|
-
icon: '
|
|
1324
|
+
icon: 'globe',
|
|
1482
1325
|
route: 'languages',
|
|
1483
1326
|
permission: LANGUAGE_PERMISSIONS.READ,
|
|
1484
1327
|
},
|
|
1485
1328
|
{
|
|
1486
1329
|
id: 'keys',
|
|
1487
1330
|
labelKey: 'localization.tabs.keys',
|
|
1488
|
-
icon: '
|
|
1331
|
+
icon: 'key',
|
|
1489
1332
|
route: 'keys',
|
|
1490
1333
|
permission: TRANSLATION_KEY_PERMISSIONS.READ,
|
|
1491
1334
|
},
|
|
@@ -1496,9 +1339,10 @@ class LocalizationContainerPage {
|
|
|
1496
1339
|
if (!permissions.length)
|
|
1497
1340
|
return [];
|
|
1498
1341
|
return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));
|
|
1499
|
-
},
|
|
1500
|
-
|
|
1501
|
-
static
|
|
1342
|
+
}, /* @ts-ignore */
|
|
1343
|
+
...(ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []));
|
|
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: `
|
|
1502
1346
|
<div class="p-2 sm:p-4">
|
|
1503
1347
|
<div class="mb-4">
|
|
1504
1348
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1512,7 +1356,7 @@ class LocalizationContainerPage {
|
|
|
1512
1356
|
routerLinkActive="tab-active"
|
|
1513
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"
|
|
1514
1358
|
>
|
|
1515
|
-
<
|
|
1359
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1516
1360
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1517
1361
|
</a>
|
|
1518
1362
|
}
|
|
@@ -1520,11 +1364,11 @@ class LocalizationContainerPage {
|
|
|
1520
1364
|
|
|
1521
1365
|
<router-outlet />
|
|
1522
1366
|
</div>
|
|
1523
|
-
`, 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", "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" }] });
|
|
1524
1368
|
}
|
|
1525
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LocalizationContainerPage, decorators: [{
|
|
1526
1370
|
type: Component,
|
|
1527
|
-
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], template: `
|
|
1371
|
+
args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe, IconComponent], template: `
|
|
1528
1372
|
<div class="p-2 sm:p-4">
|
|
1529
1373
|
<div class="mb-4">
|
|
1530
1374
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
|
|
@@ -1538,7 +1382,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1538
1382
|
routerLinkActive="tab-active"
|
|
1539
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"
|
|
1540
1384
|
>
|
|
1541
|
-
<
|
|
1385
|
+
<lib-icon [icon]="tab.icon"></lib-icon>
|
|
1542
1386
|
<span>{{ tab.labelKey | translate }}</span>
|
|
1543
1387
|
</a>
|
|
1544
1388
|
}
|
|
@@ -1606,24 +1450,33 @@ class TranslationKeyFormPage {
|
|
|
1606
1450
|
destroyRef = inject(DestroyRef);
|
|
1607
1451
|
routeParams = toSignal(this.route.paramMap);
|
|
1608
1452
|
loadTriggered = false;
|
|
1609
|
-
isSaving = signal(false,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1453
|
+
isSaving = signal(false, /* @ts-ignore */
|
|
1454
|
+
...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
1455
|
+
isLoadingLanguages = signal(false, /* @ts-ignore */
|
|
1456
|
+
...(ngDevMode ? [{ debugName: "isLoadingLanguages" }] : /* istanbul ignore next */ []));
|
|
1457
|
+
existingKey = signal(null, /* @ts-ignore */
|
|
1458
|
+
...(ngDevMode ? [{ debugName: "existingKey" }] : /* istanbul ignore next */ []));
|
|
1459
|
+
isEditMode = computed(() => !!this.existingKey(), /* @ts-ignore */
|
|
1460
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
1461
|
+
languages = signal([], /* @ts-ignore */
|
|
1462
|
+
...(ngDevMode ? [{ debugName: "languages" }] : /* istanbul ignore next */ []));
|
|
1463
|
+
modules = signal([], /* @ts-ignore */
|
|
1464
|
+
...(ngDevMode ? [{ debugName: "modules" }] : /* istanbul ignore next */ []));
|
|
1465
|
+
translations = signal([], /* @ts-ignore */
|
|
1466
|
+
...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
|
|
1616
1467
|
translate(key, vars) {
|
|
1617
1468
|
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
1618
1469
|
}
|
|
1619
|
-
moduleOptions = computed(() => this.modules().map((m) => ({ label: m, value: m })),
|
|
1470
|
+
moduleOptions = computed(() => this.modules().map((m) => ({ label: m, value: m })), /* @ts-ignore */
|
|
1471
|
+
...(ngDevMode ? [{ debugName: "moduleOptions" }] : /* istanbul ignore next */ []));
|
|
1620
1472
|
formModel = signal({
|
|
1621
1473
|
key: '',
|
|
1622
1474
|
module: '',
|
|
1623
1475
|
defaultMessage: '',
|
|
1624
1476
|
description: '',
|
|
1625
1477
|
variables: '',
|
|
1626
|
-
},
|
|
1478
|
+
}, /* @ts-ignore */
|
|
1479
|
+
...(ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []));
|
|
1627
1480
|
formTree = form(this.formModel, (f) => {
|
|
1628
1481
|
required(f.key, {
|
|
1629
1482
|
message: this.translate('localization.validation.key.required'),
|
|
@@ -1637,7 +1490,8 @@ class TranslationKeyFormPage {
|
|
|
1637
1490
|
return (model.key.trim().length > 0 &&
|
|
1638
1491
|
model.module.trim().length > 0 &&
|
|
1639
1492
|
model.defaultMessage.trim().length > 0);
|
|
1640
|
-
},
|
|
1493
|
+
}, /* @ts-ignore */
|
|
1494
|
+
...(ngDevMode ? [{ debugName: "isFormValid" }] : /* istanbul ignore next */ []));
|
|
1641
1495
|
constructor() {
|
|
1642
1496
|
effect(() => {
|
|
1643
1497
|
const params = this.routeParams();
|
|
@@ -1846,9 +1700,9 @@ class TranslationKeyFormPage {
|
|
|
1846
1700
|
onCancel() {
|
|
1847
1701
|
this.router.navigate(['/localization/keys']);
|
|
1848
1702
|
}
|
|
1849
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1850
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1851
|
-
<
|
|
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>
|
|
1852
1706
|
<ng-template #header>
|
|
1853
1707
|
<div class="flex justify-between items-center p-4">
|
|
1854
1708
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -1874,7 +1728,7 @@ class TranslationKeyFormPage {
|
|
|
1874
1728
|
>{{ 'localization.key.name' | translate }} *</label
|
|
1875
1729
|
>
|
|
1876
1730
|
<input
|
|
1877
|
-
|
|
1731
|
+
fInputText
|
|
1878
1732
|
id="key"
|
|
1879
1733
|
[formField]="formTree.key"
|
|
1880
1734
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -1886,7 +1740,7 @@ class TranslationKeyFormPage {
|
|
|
1886
1740
|
<label for="module" class="font-medium"
|
|
1887
1741
|
>{{ 'localization.key.module' | translate }} *</label
|
|
1888
1742
|
>
|
|
1889
|
-
<
|
|
1743
|
+
<f-select
|
|
1890
1744
|
id="module"
|
|
1891
1745
|
[ngModel]="formModel().module"
|
|
1892
1746
|
(ngModelChange)="updateModule($event)"
|
|
@@ -1906,7 +1760,7 @@ class TranslationKeyFormPage {
|
|
|
1906
1760
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
1907
1761
|
>
|
|
1908
1762
|
<textarea
|
|
1909
|
-
|
|
1763
|
+
fTextarea
|
|
1910
1764
|
id="defaultMessage"
|
|
1911
1765
|
[formField]="formTree.defaultMessage"
|
|
1912
1766
|
[rows]="2"
|
|
@@ -1922,7 +1776,7 @@ class TranslationKeyFormPage {
|
|
|
1922
1776
|
'localization.key.description' | translate
|
|
1923
1777
|
}}</label>
|
|
1924
1778
|
<input
|
|
1925
|
-
|
|
1779
|
+
fInputText
|
|
1926
1780
|
id="description"
|
|
1927
1781
|
[formField]="formTree.description"
|
|
1928
1782
|
[placeholder]="
|
|
@@ -1937,7 +1791,7 @@ class TranslationKeyFormPage {
|
|
|
1937
1791
|
'localization.key.variables' | translate
|
|
1938
1792
|
}}</label>
|
|
1939
1793
|
<input
|
|
1940
|
-
|
|
1794
|
+
fInputText
|
|
1941
1795
|
id="variables"
|
|
1942
1796
|
[formField]="formTree.variables"
|
|
1943
1797
|
[placeholder]="
|
|
@@ -1958,7 +1812,7 @@ class TranslationKeyFormPage {
|
|
|
1958
1812
|
</h4>
|
|
1959
1813
|
@if (isLoadingLanguages()) {
|
|
1960
1814
|
<div class="flex justify-center py-4">
|
|
1961
|
-
<
|
|
1815
|
+
<f-progressspinner strokeWidth="4" />
|
|
1962
1816
|
</div>
|
|
1963
1817
|
} @else if (languages().length === 0) {
|
|
1964
1818
|
<p class="text-muted-color text-center py-4">
|
|
@@ -1977,14 +1831,14 @@ class TranslationKeyFormPage {
|
|
|
1977
1831
|
>
|
|
1978
1832
|
}
|
|
1979
1833
|
</label>
|
|
1980
|
-
<
|
|
1834
|
+
<f-tag
|
|
1981
1835
|
[value]="lang.code"
|
|
1982
1836
|
severity="secondary"
|
|
1983
1837
|
class="uppercase"
|
|
1984
1838
|
/>
|
|
1985
1839
|
</div>
|
|
1986
1840
|
<textarea
|
|
1987
|
-
|
|
1841
|
+
fTextarea
|
|
1988
1842
|
[ngModel]="getTranslationValue(lang.id)"
|
|
1989
1843
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
1990
1844
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2002,37 +1856,41 @@ class TranslationKeyFormPage {
|
|
|
2002
1856
|
|
|
2003
1857
|
<!-- Actions -->
|
|
2004
1858
|
<div class="flex justify-end gap-4 pt-4">
|
|
2005
|
-
<
|
|
2006
|
-
|
|
1859
|
+
<button
|
|
1860
|
+
fButton
|
|
2007
1861
|
severity="secondary"
|
|
2008
1862
|
[outlined]="true"
|
|
2009
|
-
(
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
1863
|
+
(click)="onCancel()"
|
|
1864
|
+
>
|
|
1865
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
1866
|
+
</button>
|
|
1867
|
+
<button
|
|
1868
|
+
fButton
|
|
1869
|
+
type="submit"
|
|
1870
|
+
[disabled]="!isFormValid() || isSaving()"
|
|
1871
|
+
>
|
|
1872
|
+
@if (isSaving()) {
|
|
1873
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
1874
|
+
}
|
|
1875
|
+
<span pButtonLabel>{{
|
|
2013
1876
|
isEditMode()
|
|
2014
1877
|
? ('shared.update' | translate)
|
|
2015
1878
|
: ('shared.create' | translate)
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
[loading]="isSaving()"
|
|
2019
|
-
[disabled]="!isFormValid() || isSaving()"
|
|
2020
|
-
/>
|
|
1879
|
+
}}</span>
|
|
1880
|
+
</button>
|
|
2021
1881
|
</div>
|
|
2022
1882
|
</form>
|
|
2023
|
-
</
|
|
2024
|
-
|
|
2025
|
-
<p-toast />
|
|
2026
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i5.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i4$1.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "directive", type: i7.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "component", type: i6.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i9.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
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" }] });
|
|
2027
1885
|
}
|
|
2028
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyFormPage, decorators: [{
|
|
2029
1887
|
type: Component,
|
|
2030
1888
|
args: [{
|
|
2031
1889
|
selector: 'lib-translation-key-form-page',
|
|
2032
|
-
imports: [
|
|
1890
|
+
imports: [UiModule, AngularModule, FormsModule, FormField, TranslatePipe],
|
|
2033
1891
|
providers: [MessageService],
|
|
2034
1892
|
template: `
|
|
2035
|
-
<
|
|
1893
|
+
<f-card>
|
|
2036
1894
|
<ng-template #header>
|
|
2037
1895
|
<div class="flex justify-between items-center p-4">
|
|
2038
1896
|
<h2 class="text-xl font-semibold m-0">
|
|
@@ -2058,7 +1916,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2058
1916
|
>{{ 'localization.key.name' | translate }} *</label
|
|
2059
1917
|
>
|
|
2060
1918
|
<input
|
|
2061
|
-
|
|
1919
|
+
fInputText
|
|
2062
1920
|
id="key"
|
|
2063
1921
|
[formField]="formTree.key"
|
|
2064
1922
|
[placeholder]="'localization.placeholder.key.name' | translate"
|
|
@@ -2070,7 +1928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2070
1928
|
<label for="module" class="font-medium"
|
|
2071
1929
|
>{{ 'localization.key.module' | translate }} *</label
|
|
2072
1930
|
>
|
|
2073
|
-
<
|
|
1931
|
+
<f-select
|
|
2074
1932
|
id="module"
|
|
2075
1933
|
[ngModel]="formModel().module"
|
|
2076
1934
|
(ngModelChange)="updateModule($event)"
|
|
@@ -2090,7 +1948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2090
1948
|
>{{ 'localization.key.default.message' | translate }} *</label
|
|
2091
1949
|
>
|
|
2092
1950
|
<textarea
|
|
2093
|
-
|
|
1951
|
+
fTextarea
|
|
2094
1952
|
id="defaultMessage"
|
|
2095
1953
|
[formField]="formTree.defaultMessage"
|
|
2096
1954
|
[rows]="2"
|
|
@@ -2106,7 +1964,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2106
1964
|
'localization.key.description' | translate
|
|
2107
1965
|
}}</label>
|
|
2108
1966
|
<input
|
|
2109
|
-
|
|
1967
|
+
fInputText
|
|
2110
1968
|
id="description"
|
|
2111
1969
|
[formField]="formTree.description"
|
|
2112
1970
|
[placeholder]="
|
|
@@ -2121,7 +1979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2121
1979
|
'localization.key.variables' | translate
|
|
2122
1980
|
}}</label>
|
|
2123
1981
|
<input
|
|
2124
|
-
|
|
1982
|
+
fInputText
|
|
2125
1983
|
id="variables"
|
|
2126
1984
|
[formField]="formTree.variables"
|
|
2127
1985
|
[placeholder]="
|
|
@@ -2142,7 +2000,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2142
2000
|
</h4>
|
|
2143
2001
|
@if (isLoadingLanguages()) {
|
|
2144
2002
|
<div class="flex justify-center py-4">
|
|
2145
|
-
<
|
|
2003
|
+
<f-progressspinner strokeWidth="4" />
|
|
2146
2004
|
</div>
|
|
2147
2005
|
} @else if (languages().length === 0) {
|
|
2148
2006
|
<p class="text-muted-color text-center py-4">
|
|
@@ -2161,14 +2019,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2161
2019
|
>
|
|
2162
2020
|
}
|
|
2163
2021
|
</label>
|
|
2164
|
-
<
|
|
2022
|
+
<f-tag
|
|
2165
2023
|
[value]="lang.code"
|
|
2166
2024
|
severity="secondary"
|
|
2167
2025
|
class="uppercase"
|
|
2168
2026
|
/>
|
|
2169
2027
|
</div>
|
|
2170
2028
|
<textarea
|
|
2171
|
-
|
|
2029
|
+
fTextarea
|
|
2172
2030
|
[ngModel]="getTranslationValue(lang.id)"
|
|
2173
2031
|
(ngModelChange)="setTranslationValue(lang.id, $event)"
|
|
2174
2032
|
[ngModelOptions]="{ standalone: true }"
|
|
@@ -2186,27 +2044,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2186
2044
|
|
|
2187
2045
|
<!-- Actions -->
|
|
2188
2046
|
<div class="flex justify-end gap-4 pt-4">
|
|
2189
|
-
<
|
|
2190
|
-
|
|
2047
|
+
<button
|
|
2048
|
+
fButton
|
|
2191
2049
|
severity="secondary"
|
|
2192
2050
|
[outlined]="true"
|
|
2193
|
-
(
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2051
|
+
(click)="onCancel()"
|
|
2052
|
+
>
|
|
2053
|
+
<span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
|
|
2054
|
+
</button>
|
|
2055
|
+
<button
|
|
2056
|
+
fButton
|
|
2057
|
+
type="submit"
|
|
2058
|
+
[disabled]="!isFormValid() || isSaving()"
|
|
2059
|
+
>
|
|
2060
|
+
@if (isSaving()) {
|
|
2061
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
2062
|
+
}
|
|
2063
|
+
<span pButtonLabel>{{
|
|
2197
2064
|
isEditMode()
|
|
2198
2065
|
? ('shared.update' | translate)
|
|
2199
2066
|
: ('shared.create' | translate)
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
[loading]="isSaving()"
|
|
2203
|
-
[disabled]="!isFormValid() || isSaving()"
|
|
2204
|
-
/>
|
|
2067
|
+
}}</span>
|
|
2068
|
+
</button>
|
|
2205
2069
|
</div>
|
|
2206
2070
|
</form>
|
|
2207
|
-
</
|
|
2208
|
-
|
|
2209
|
-
<p-toast />
|
|
2071
|
+
</f-card>
|
|
2210
2072
|
`,
|
|
2211
2073
|
}]
|
|
2212
2074
|
}], ctorParameters: () => [] });
|
|
@@ -2226,17 +2088,25 @@ class TranslationKeyListPage {
|
|
|
2226
2088
|
messageService = inject(MessageService);
|
|
2227
2089
|
translateService = inject(TranslateService);
|
|
2228
2090
|
destroyRef = inject(DestroyRef);
|
|
2229
|
-
isLoading = signal(false,
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2091
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
2092
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
2093
|
+
languages = signal([], /* @ts-ignore */
|
|
2094
|
+
...(ngDevMode ? [{ debugName: "languages" }] : /* istanbul ignore next */ []));
|
|
2095
|
+
modules = signal([], /* @ts-ignore */
|
|
2096
|
+
...(ngDevMode ? [{ debugName: "modules" }] : /* istanbul ignore next */ []));
|
|
2097
|
+
translationKeys = signal([], /* @ts-ignore */
|
|
2098
|
+
...(ngDevMode ? [{ debugName: "translationKeys" }] : /* istanbul ignore next */ []));
|
|
2099
|
+
translationCounts = signal(new Map(), /* @ts-ignore */
|
|
2100
|
+
...(ngDevMode ? [{ debugName: "translationCounts" }] : /* istanbul ignore next */ []));
|
|
2101
|
+
selectedModule = signal(null, /* @ts-ignore */
|
|
2102
|
+
...(ngDevMode ? [{ debugName: "selectedModule" }] : /* istanbul ignore next */ []));
|
|
2103
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
2104
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
2236
2105
|
moduleOptions = computed(() => [
|
|
2237
2106
|
{ label: this.translateService.translate('shared.all'), value: null },
|
|
2238
2107
|
...this.modules().map((m) => ({ label: m, value: m })),
|
|
2239
|
-
],
|
|
2108
|
+
], /* @ts-ignore */
|
|
2109
|
+
...(ngDevMode ? [{ debugName: "moduleOptions" }] : /* istanbul ignore next */ []));
|
|
2240
2110
|
filteredKeys = computed(() => {
|
|
2241
2111
|
let keys = this.translationKeys();
|
|
2242
2112
|
const module = this.selectedModule();
|
|
@@ -2250,7 +2120,8 @@ class TranslationKeyListPage {
|
|
|
2250
2120
|
k.module.toLowerCase().includes(search));
|
|
2251
2121
|
}
|
|
2252
2122
|
return keys;
|
|
2253
|
-
},
|
|
2123
|
+
}, /* @ts-ignore */
|
|
2124
|
+
...(ngDevMode ? [{ debugName: "filteredKeys" }] : /* istanbul ignore next */ []));
|
|
2254
2125
|
ngOnInit() {
|
|
2255
2126
|
this.loadData();
|
|
2256
2127
|
}
|
|
@@ -2317,7 +2188,7 @@ class TranslationKeyListPage {
|
|
|
2317
2188
|
this.confirmationService.confirm({
|
|
2318
2189
|
message: this.translateService.translate('shared.confirm.delete'),
|
|
2319
2190
|
header: this.translateService.translate('localization.key.delete.title'),
|
|
2320
|
-
icon: '
|
|
2191
|
+
icon: 'exclamation-triangle',
|
|
2321
2192
|
acceptButtonStyleClass: 'p-button-danger',
|
|
2322
2193
|
accept: () => {
|
|
2323
2194
|
from(this.translationKeyService.delete({ id: key.id, type: 'delete' }))
|
|
@@ -2339,8 +2210,8 @@ class TranslationKeyListPage {
|
|
|
2339
2210
|
},
|
|
2340
2211
|
});
|
|
2341
2212
|
}
|
|
2342
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2343
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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: `
|
|
2344
2215
|
<div class="card">
|
|
2345
2216
|
<div
|
|
2346
2217
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -2354,18 +2225,20 @@ class TranslationKeyListPage {
|
|
|
2354
2225
|
</p>
|
|
2355
2226
|
</div>
|
|
2356
2227
|
<div class="flex gap-2">
|
|
2357
|
-
<
|
|
2228
|
+
<button
|
|
2229
|
+
fButton
|
|
2358
2230
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2231
|
+
(click)="onCreate()"
|
|
2232
|
+
>
|
|
2233
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2234
|
+
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2235
|
+
</button>
|
|
2363
2236
|
</div>
|
|
2364
2237
|
</div>
|
|
2365
2238
|
|
|
2366
2239
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2367
2240
|
<div class="flex-1">
|
|
2368
|
-
<
|
|
2241
|
+
<f-select
|
|
2369
2242
|
[options]="moduleOptions()"
|
|
2370
2243
|
[ngModel]="selectedModule()"
|
|
2371
2244
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2378,28 +2251,27 @@ class TranslationKeyListPage {
|
|
|
2378
2251
|
/>
|
|
2379
2252
|
</div>
|
|
2380
2253
|
<div class="flex-1">
|
|
2381
|
-
<
|
|
2382
|
-
<
|
|
2254
|
+
<f-iconfield class="w-full">
|
|
2255
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2383
2256
|
<input
|
|
2384
|
-
|
|
2257
|
+
fInputText
|
|
2385
2258
|
[ngModel]="searchTerm()"
|
|
2386
2259
|
(ngModelChange)="searchTerm.set($event)"
|
|
2387
2260
|
[ngModelOptions]="{ standalone: true }"
|
|
2388
2261
|
[placeholder]="'shared.search' | translate"
|
|
2389
2262
|
class="w-full"
|
|
2390
2263
|
/>
|
|
2391
|
-
</
|
|
2264
|
+
</f-iconfield>
|
|
2392
2265
|
</div>
|
|
2393
2266
|
</div>
|
|
2394
2267
|
|
|
2395
2268
|
<!-- Table -->
|
|
2396
|
-
<
|
|
2269
|
+
<f-table
|
|
2397
2270
|
[value]="filteredKeys()"
|
|
2398
2271
|
[loading]="isLoading()"
|
|
2399
2272
|
[paginator]="true"
|
|
2400
2273
|
[rows]="15"
|
|
2401
2274
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2402
|
-
class="p-datatable-sm"
|
|
2403
2275
|
>
|
|
2404
2276
|
<ng-template #header>
|
|
2405
2277
|
<tr>
|
|
@@ -2423,7 +2295,7 @@ class TranslationKeyListPage {
|
|
|
2423
2295
|
@let languageCount = languages().length;
|
|
2424
2296
|
<tr>
|
|
2425
2297
|
<td>
|
|
2426
|
-
<
|
|
2298
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2427
2299
|
</td>
|
|
2428
2300
|
<td>
|
|
2429
2301
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2446,24 +2318,28 @@ class TranslationKeyListPage {
|
|
|
2446
2318
|
</td>
|
|
2447
2319
|
<td>
|
|
2448
2320
|
<div class="flex gap-1">
|
|
2449
|
-
<
|
|
2321
|
+
<button
|
|
2322
|
+
fButton
|
|
2450
2323
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2451
|
-
icon="pi pi-pencil"
|
|
2452
2324
|
[text]="true"
|
|
2453
2325
|
severity="secondary"
|
|
2454
2326
|
size="small"
|
|
2455
|
-
[
|
|
2456
|
-
(
|
|
2457
|
-
|
|
2458
|
-
|
|
2327
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2328
|
+
(click)="onEdit(key)"
|
|
2329
|
+
>
|
|
2330
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2331
|
+
</button>
|
|
2332
|
+
<button
|
|
2333
|
+
fButton
|
|
2459
2334
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2460
|
-
icon="pi pi-trash"
|
|
2461
2335
|
[text]="true"
|
|
2462
2336
|
severity="danger"
|
|
2463
2337
|
size="small"
|
|
2464
|
-
[
|
|
2465
|
-
(
|
|
2466
|
-
|
|
2338
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2339
|
+
(click)="onDelete(key)"
|
|
2340
|
+
>
|
|
2341
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2342
|
+
</button>
|
|
2467
2343
|
</div>
|
|
2468
2344
|
</td>
|
|
2469
2345
|
</tr>
|
|
@@ -2475,25 +2351,24 @@ class TranslationKeyListPage {
|
|
|
2475
2351
|
</td>
|
|
2476
2352
|
</tr>
|
|
2477
2353
|
</ng-template>
|
|
2478
|
-
</
|
|
2354
|
+
</f-table>
|
|
2479
2355
|
</div>
|
|
2480
2356
|
|
|
2481
|
-
<
|
|
2482
|
-
<
|
|
2483
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type:
|
|
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" }] });
|
|
2484
2360
|
}
|
|
2485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslationKeyListPage, decorators: [{
|
|
2486
2362
|
type: Component,
|
|
2487
2363
|
args: [{
|
|
2488
2364
|
selector: 'lib-translation-key-list-page',
|
|
2489
2365
|
imports: [
|
|
2490
2366
|
AngularModule,
|
|
2491
|
-
|
|
2367
|
+
UiModule,
|
|
2492
2368
|
FormsModule,
|
|
2493
2369
|
HasPermissionDirective,
|
|
2494
2370
|
TranslatePipe,
|
|
2495
2371
|
],
|
|
2496
|
-
providers: [ConfirmationService, MessageService],
|
|
2497
2372
|
template: `
|
|
2498
2373
|
<div class="card">
|
|
2499
2374
|
<div
|
|
@@ -2508,18 +2383,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2508
2383
|
</p>
|
|
2509
2384
|
</div>
|
|
2510
2385
|
<div class="flex gap-2">
|
|
2511
|
-
<
|
|
2386
|
+
<button
|
|
2387
|
+
fButton
|
|
2512
2388
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2389
|
+
(click)="onCreate()"
|
|
2390
|
+
>
|
|
2391
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
2392
|
+
<span pButtonLabel>{{ 'localization.key.new' | translate }}</span>
|
|
2393
|
+
</button>
|
|
2517
2394
|
</div>
|
|
2518
2395
|
</div>
|
|
2519
2396
|
|
|
2520
2397
|
<div class="flex flex-col md:flex-row gap-4 mb-4">
|
|
2521
2398
|
<div class="flex-1">
|
|
2522
|
-
<
|
|
2399
|
+
<f-select
|
|
2523
2400
|
[options]="moduleOptions()"
|
|
2524
2401
|
[ngModel]="selectedModule()"
|
|
2525
2402
|
(ngModelChange)="onModuleChange($event)"
|
|
@@ -2532,28 +2409,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2532
2409
|
/>
|
|
2533
2410
|
</div>
|
|
2534
2411
|
<div class="flex-1">
|
|
2535
|
-
<
|
|
2536
|
-
<
|
|
2412
|
+
<f-iconfield class="w-full">
|
|
2413
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
2537
2414
|
<input
|
|
2538
|
-
|
|
2415
|
+
fInputText
|
|
2539
2416
|
[ngModel]="searchTerm()"
|
|
2540
2417
|
(ngModelChange)="searchTerm.set($event)"
|
|
2541
2418
|
[ngModelOptions]="{ standalone: true }"
|
|
2542
2419
|
[placeholder]="'shared.search' | translate"
|
|
2543
2420
|
class="w-full"
|
|
2544
2421
|
/>
|
|
2545
|
-
</
|
|
2422
|
+
</f-iconfield>
|
|
2546
2423
|
</div>
|
|
2547
2424
|
</div>
|
|
2548
2425
|
|
|
2549
2426
|
<!-- Table -->
|
|
2550
|
-
<
|
|
2427
|
+
<f-table
|
|
2551
2428
|
[value]="filteredKeys()"
|
|
2552
2429
|
[loading]="isLoading()"
|
|
2553
2430
|
[paginator]="true"
|
|
2554
2431
|
[rows]="15"
|
|
2555
2432
|
[rowsPerPageOptions]="[10, 15, 25, 50]"
|
|
2556
|
-
class="p-datatable-sm"
|
|
2557
2433
|
>
|
|
2558
2434
|
<ng-template #header>
|
|
2559
2435
|
<tr>
|
|
@@ -2577,7 +2453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2577
2453
|
@let languageCount = languages().length;
|
|
2578
2454
|
<tr>
|
|
2579
2455
|
<td>
|
|
2580
|
-
<
|
|
2456
|
+
<f-tag [value]="key.module" severity="secondary" />
|
|
2581
2457
|
</td>
|
|
2582
2458
|
<td>
|
|
2583
2459
|
<div class="font-medium">{{ key.key }}</div>
|
|
@@ -2600,24 +2476,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2600
2476
|
</td>
|
|
2601
2477
|
<td>
|
|
2602
2478
|
<div class="flex gap-1">
|
|
2603
|
-
<
|
|
2479
|
+
<button
|
|
2480
|
+
fButton
|
|
2604
2481
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
|
|
2605
|
-
icon="pi pi-pencil"
|
|
2606
2482
|
[text]="true"
|
|
2607
2483
|
severity="secondary"
|
|
2608
2484
|
size="small"
|
|
2609
|
-
[
|
|
2610
|
-
(
|
|
2611
|
-
|
|
2612
|
-
|
|
2485
|
+
[fTooltip]="'shared.edit' | translate"
|
|
2486
|
+
(click)="onEdit(key)"
|
|
2487
|
+
>
|
|
2488
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2489
|
+
</button>
|
|
2490
|
+
<button
|
|
2491
|
+
fButton
|
|
2613
2492
|
*hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
|
|
2614
|
-
icon="pi pi-trash"
|
|
2615
2493
|
[text]="true"
|
|
2616
2494
|
severity="danger"
|
|
2617
2495
|
size="small"
|
|
2618
|
-
[
|
|
2619
|
-
(
|
|
2620
|
-
|
|
2496
|
+
[fTooltip]="'shared.delete' | translate"
|
|
2497
|
+
(click)="onDelete(key)"
|
|
2498
|
+
>
|
|
2499
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2500
|
+
</button>
|
|
2621
2501
|
</div>
|
|
2622
2502
|
</td>
|
|
2623
2503
|
</tr>
|
|
@@ -2629,11 +2509,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2629
2509
|
</td>
|
|
2630
2510
|
</tr>
|
|
2631
2511
|
</ng-template>
|
|
2632
|
-
</
|
|
2512
|
+
</f-table>
|
|
2633
2513
|
</div>
|
|
2634
2514
|
|
|
2635
|
-
<
|
|
2636
|
-
<
|
|
2515
|
+
<f-confirmdialog />
|
|
2516
|
+
<f-toast />
|
|
2637
2517
|
`,
|
|
2638
2518
|
}]
|
|
2639
2519
|
}] });
|