@flusys/ng-localization 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -320,13 +320,13 @@ class LocalizationStateService {
320
320
  hasModuleFallbacks(module) {
321
321
  return this._moduleFallbacks.has(module);
322
322
  }
323
- static ɵfac = function LocalizationStateService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalizationStateService)(); };
324
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalizationStateService, factory: LocalizationStateService.ɵfac, providedIn: 'root' });
323
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
324
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationStateService, providedIn: 'root' });
325
325
  }
326
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalizationStateService, [{
327
- type: Injectable,
328
- args: [{ providedIn: 'root' }]
329
- }], () => [], null); })();
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationStateService, decorators: [{
327
+ type: Injectable,
328
+ args: [{ providedIn: 'root' }]
329
+ }], ctorParameters: () => [] });
330
330
 
331
331
  class LocalizationApiService {
332
332
  http = inject(HttpClient);
@@ -340,13 +340,13 @@ class LocalizationApiService {
340
340
  getTranslationsByLanguage(languageCode, modules) {
341
341
  return this.http.post(`${this.baseUrl}/translation/get-by-language`, { languageCode, ...(modules?.length ? { modules } : {}) });
342
342
  }
343
- static ɵfac = function LocalizationApiService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalizationApiService)(); };
344
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalizationApiService, factory: LocalizationApiService.ɵfac, providedIn: 'root' });
343
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
344
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationApiService, providedIn: 'root' });
345
345
  }
346
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalizationApiService, [{
347
- type: Injectable,
348
- args: [{ providedIn: 'root' }]
349
- }], null, null); })();
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationApiService, decorators: [{
347
+ type: Injectable,
348
+ args: [{ providedIn: 'root' }]
349
+ }] });
350
350
 
351
351
  class LocalizationInitializerService {
352
352
  config = inject(LOCALIZATION_CONFIG, { optional: true });
@@ -383,13 +383,13 @@ class LocalizationInitializerService {
383
383
  this.stateService.setInitialized(true);
384
384
  }
385
385
  }
386
- static ɵfac = function LocalizationInitializerService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalizationInitializerService)(); };
387
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalizationInitializerService, factory: LocalizationInitializerService.ɵfac, providedIn: 'root' });
386
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationInitializerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
387
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationInitializerService, providedIn: 'root' });
388
388
  }
389
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalizationInitializerService, [{
390
- type: Injectable,
391
- args: [{ providedIn: 'root' }]
392
- }], null, null); })();
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationInitializerService, decorators: [{
390
+ type: Injectable,
391
+ args: [{ providedIn: 'root' }]
392
+ }] });
393
393
 
394
394
  class TranslateService {
395
395
  localizationState = inject(LocalizationStateService);
@@ -428,13 +428,13 @@ class TranslateService {
428
428
  const value = fallbacks[key] ?? key;
429
429
  return this.interpolate(value, params);
430
430
  }
431
- static ɵfac = function TranslateService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslateService)(); };
432
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TranslateService, factory: TranslateService.ɵfac, providedIn: 'root' });
431
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
432
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslateService, providedIn: 'root' });
433
433
  }
434
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslateService, [{
435
- type: Injectable,
436
- args: [{ providedIn: 'root' }]
437
- }], null, null); })();
434
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslateService, decorators: [{
435
+ type: Injectable,
436
+ args: [{ providedIn: 'root' }]
437
+ }] });
438
438
 
439
439
  class TranslationLoaderService {
440
440
  DEFAULT_INITIAL_MODULES = ['shared', 'layout'];
@@ -499,13 +499,13 @@ class TranslationLoaderService {
499
499
  loadTranslationsAsync(languageCode, clearModules = false) {
500
500
  return from(this.loadTranslations(languageCode, clearModules));
501
501
  }
502
- static ɵfac = function TranslationLoaderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationLoaderService)(); };
503
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TranslationLoaderService, factory: TranslationLoaderService.ɵfac, providedIn: 'root' });
502
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
503
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationLoaderService, providedIn: 'root' });
504
504
  }
505
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationLoaderService, [{
506
- type: Injectable,
507
- args: [{ providedIn: 'root' }]
508
- }], null, null); })();
505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationLoaderService, decorators: [{
506
+ type: Injectable,
507
+ args: [{ providedIn: 'root' }]
508
+ }] });
509
509
 
510
510
  class LanguageApiService {
511
511
  http = inject(HttpClient);
@@ -535,13 +535,13 @@ class LanguageApiService {
535
535
  setDefault(id) {
536
536
  return this.http.post(`${this.baseUrl}/set-default`, { id });
537
537
  }
538
- static ɵfac = function LanguageApiService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguageApiService)(); };
539
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LanguageApiService, factory: LanguageApiService.ɵfac, providedIn: 'root' });
538
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
539
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageApiService, providedIn: 'root' });
540
540
  }
541
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageApiService, [{
542
- type: Injectable,
543
- args: [{ providedIn: 'root' }]
544
- }], null, null); })();
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageApiService, decorators: [{
542
+ type: Injectable,
543
+ args: [{ providedIn: 'root' }]
544
+ }] });
545
545
 
546
546
  class TranslationKeyApiService {
547
547
  http = inject(HttpClient);
@@ -579,13 +579,13 @@ class TranslationKeyApiService {
579
579
  delete(id) {
580
580
  return this.http.post(`${this.baseUrl}/delete`, { id, type: 'delete' });
581
581
  }
582
- static ɵfac = function TranslationKeyApiService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationKeyApiService)(); };
583
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TranslationKeyApiService, factory: TranslationKeyApiService.ɵfac, providedIn: 'root' });
582
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
583
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyApiService, providedIn: 'root' });
584
584
  }
585
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationKeyApiService, [{
586
- type: Injectable,
587
- args: [{ providedIn: 'root' }]
588
- }], null, null); })();
585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyApiService, decorators: [{
586
+ type: Injectable,
587
+ args: [{ providedIn: 'root' }]
588
+ }] });
589
589
 
590
590
  class TranslationApiService {
591
591
  http = inject(HttpClient);
@@ -632,41 +632,14 @@ class TranslationApiService {
632
632
  getCounts() {
633
633
  return this.http.post(`${this.baseUrl}/get-counts`, {});
634
634
  }
635
- static ɵfac = function TranslationApiService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationApiService)(); };
636
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TranslationApiService, factory: TranslationApiService.ɵfac, providedIn: 'root' });
635
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
636
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationApiService, providedIn: 'root' });
637
637
  }
638
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationApiService, [{
639
- type: Injectable,
640
- args: [{ providedIn: 'root' }]
641
- }], null, null); })();
642
-
643
- const _forTrack0$3 = ($index, $item) => $item.id;
644
- function LanguageSelectorComponent_For_7_Conditional_5_Template(rf, ctx) { if (rf & 1) {
645
- i0.ɵɵelement(0, "i", 9);
646
- } }
647
- function LanguageSelectorComponent_For_7_Template(rf, ctx) { if (rf & 1) {
648
- const _r1 = i0.ɵɵgetCurrentView();
649
- i0.ɵɵelementStart(0, "button", 6);
650
- i0.ɵɵlistener("click", function LanguageSelectorComponent_For_7_Template_button_click_0_listener() { const lang_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onLanguageSelect(lang_r2.code)); });
651
- i0.ɵɵelementStart(1, "span", 7);
652
- i0.ɵɵtext(2);
653
- i0.ɵɵelementEnd();
654
- i0.ɵɵelementStart(3, "span", 8);
655
- i0.ɵɵtext(4);
656
- i0.ɵɵelementEnd();
657
- i0.ɵɵconditionalCreate(5, LanguageSelectorComponent_For_7_Conditional_5_Template, 1, 0, "i", 9);
658
- i0.ɵɵelementEnd();
659
- } if (rf & 2) {
660
- const lang_r2 = ctx.$implicit;
661
- const ctx_r2 = i0.ɵɵnextContext();
662
- i0.ɵɵclassProp("bg-primary-50", lang_r2.code === ctx_r2.selectedLanguageCode())("text-primary", lang_r2.code === ctx_r2.selectedLanguageCode());
663
- i0.ɵɵadvance(2);
664
- i0.ɵɵtextInterpolate(lang_r2.nativeName || lang_r2.name);
665
- i0.ɵɵadvance(2);
666
- i0.ɵɵtextInterpolate1("(", lang_r2.code, ")");
667
- i0.ɵɵadvance();
668
- i0.ɵɵconditional(lang_r2.code === ctx_r2.selectedLanguageCode() ? 5 : -1);
669
- } }
638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationApiService, decorators: [{
639
+ type: Injectable,
640
+ args: [{ providedIn: 'root' }]
641
+ }] });
642
+
670
643
  class LanguageSelectorComponent {
671
644
  localizationState = inject(LocalizationStateService);
672
645
  translationLoader = inject(TranslationLoaderService);
@@ -702,34 +675,51 @@ class LanguageSelectorComponent {
702
675
  .subscribe();
703
676
  }
704
677
  }
705
- static ɵfac = function LanguageSelectorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguageSelectorComponent)(); };
706
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguageSelectorComponent, selectors: [["lib-language-selector"]], hostAttrs: [1, "relative"], decls: 8, vars: 4, consts: [["type", "button", "pStyleClass", "@next", "enterFromClass", "hidden", "enterActiveClass", "animate-scalein", "leaveToClass", "hidden", "leaveActiveClass", "animate-fadeout", 1, "layout-topbar-action", 3, "click", "hideOnOutsideClick"], [1, "pi", "pi-globe"], [1, "font-semibold"], [1, "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]", 2, "background-color", "var(--surface-overlay)", "inset-inline-end", "0"], [1, "flex", "flex-col"], ["type", "button", 1, "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", 3, "bg-primary-50", "text-primary"], ["type", "button", 1, "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", 3, "click"], [1, "font-medium", "flex-1"], [1, "text-xs", "text-muted-color", "uppercase"], [1, "pi", "pi-check", "text-primary", "text-sm"]], template: function LanguageSelectorComponent_Template(rf, ctx) { if (rf & 1) {
707
- i0.ɵɵelementStart(0, "button", 0);
708
- i0.ɵɵlistener("click", function LanguageSelectorComponent_Template_button_click_0_listener() { return ctx.togglePanel(); });
709
- i0.ɵɵelement(1, "i", 1);
710
- i0.ɵɵelementStart(2, "span", 2);
711
- i0.ɵɵtext(3);
712
- i0.ɵɵelementEnd()();
713
- i0.ɵɵelementStart(4, "div", 3)(5, "div", 4);
714
- i0.ɵɵrepeaterCreate(6, LanguageSelectorComponent_For_7_Template, 6, 7, "button", 5, _forTrack0$3);
715
- i0.ɵɵelementEnd()();
716
- } if (rf & 2) {
717
- let tmp_2_0;
718
- i0.ɵɵclassProp("layout-topbar-action-highlight", ctx.isActive());
719
- i0.ɵɵproperty("hideOnOutsideClick", true);
720
- i0.ɵɵadvance(3);
721
- i0.ɵɵtextInterpolate(((tmp_2_0 = ctx.selectedLanguage()) == null ? null : tmp_2_0.nativeName) || ((tmp_2_0 = ctx.selectedLanguage()) == null ? null : tmp_2_0.name) || ctx.selectedLanguageCode());
722
- i0.ɵɵadvance(3);
723
- i0.ɵɵrepeater(ctx.languages());
724
- } }, dependencies: [StyleClassModule, i1.StyleClass], encapsulation: 2 });
678
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
679
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: LanguageSelectorComponent, isStandalone: true, selector: "lib-language-selector", host: { classAttribute: "relative" }, ngImport: i0, template: `
680
+ <button
681
+ type="button"
682
+ class="layout-topbar-action"
683
+ [class.layout-topbar-action-highlight]="isActive()"
684
+ pStyleClass="@next"
685
+ enterFromClass="hidden"
686
+ enterActiveClass="animate-scalein"
687
+ leaveToClass="hidden"
688
+ leaveActiveClass="animate-fadeout"
689
+ [hideOnOutsideClick]="true"
690
+ (click)="togglePanel()">
691
+ <i class="pi pi-globe"></i>
692
+ <span class="font-semibold">{{ selectedLanguage()?.nativeName || selectedLanguage()?.name || selectedLanguageCode() }}</span>
693
+ </button>
694
+ <div
695
+ 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]"
696
+ style="background-color: var(--surface-overlay); inset-inline-end: 0;">
697
+ <div class="flex flex-col">
698
+ @for (lang of languages(); track lang.id) {
699
+ <button
700
+ type="button"
701
+ 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"
702
+ [class.bg-primary-50]="lang.code === selectedLanguageCode()"
703
+ [class.text-primary]="lang.code === selectedLanguageCode()"
704
+ (click)="onLanguageSelect(lang.code)">
705
+ <span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
706
+ <span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
707
+ @if (lang.code === selectedLanguageCode()) {
708
+ <i class="pi pi-check text-primary text-sm"></i>
709
+ }
710
+ </button>
711
+ }
712
+ </div>
713
+ </div>
714
+ `, 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"] }] });
725
715
  }
726
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageSelectorComponent, [{
727
- type: Component,
728
- args: [{
729
- selector: 'lib-language-selector',
730
- imports: [StyleClassModule],
731
- host: { class: 'relative' },
732
- template: `
716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
717
+ type: Component,
718
+ args: [{
719
+ selector: 'lib-language-selector',
720
+ imports: [StyleClassModule],
721
+ host: { class: 'relative' },
722
+ template: `
733
723
  <button
734
724
  type="button"
735
725
  class="layout-topbar-action"
@@ -765,37 +755,9 @@ class LanguageSelectorComponent {
765
755
  </div>
766
756
  </div>
767
757
  `,
768
- }]
769
- }], () => [], null); })();
770
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguageSelectorComponent, { className: "LanguageSelectorComponent", filePath: "components/language-selector/language-selector.component.ts", lineNumber: 51 }); })();
771
-
772
- const _forTrack0$2 = ($index, $item) => $item.id;
773
- function LanguageSelectorPanelComponent_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
774
- i0.ɵɵdomElement(0, "i", 5);
775
- } }
776
- function LanguageSelectorPanelComponent_For_2_Template(rf, ctx) { if (rf & 1) {
777
- const _r1 = i0.ɵɵgetCurrentView();
778
- i0.ɵɵdomElementStart(0, "button", 2);
779
- i0.ɵɵdomListener("click", function LanguageSelectorPanelComponent_For_2_Template_button_click_0_listener() { const lang_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onLanguageSelect(lang_r2.code)); });
780
- i0.ɵɵdomElementStart(1, "span", 3);
781
- i0.ɵɵtext(2);
782
- i0.ɵɵdomElementEnd();
783
- i0.ɵɵdomElementStart(3, "span", 4);
784
- i0.ɵɵtext(4);
785
- i0.ɵɵdomElementEnd();
786
- i0.ɵɵconditionalCreate(5, LanguageSelectorPanelComponent_For_2_Conditional_5_Template, 1, 0, "i", 5);
787
- i0.ɵɵdomElementEnd();
788
- } if (rf & 2) {
789
- const lang_r2 = ctx.$implicit;
790
- const ctx_r2 = i0.ɵɵnextContext();
791
- i0.ɵɵclassProp("bg-primary-50", lang_r2.code === ctx_r2.selectedLanguageCode())("text-primary", lang_r2.code === ctx_r2.selectedLanguageCode());
792
- i0.ɵɵadvance(2);
793
- i0.ɵɵtextInterpolate(lang_r2.nativeName || lang_r2.name);
794
- i0.ɵɵadvance(2);
795
- i0.ɵɵtextInterpolate1("(", lang_r2.code, ")");
796
- i0.ɵɵadvance();
797
- i0.ɵɵconditional(lang_r2.code === ctx_r2.selectedLanguageCode() ? 5 : -1);
798
- } }
758
+ }]
759
+ }], ctorParameters: () => [] });
760
+
799
761
  class LanguageSelectorPanelComponent {
800
762
  localizationState = inject(LocalizationStateService);
801
763
  translationLoader = inject(TranslationLoaderService);
@@ -822,26 +784,36 @@ class LanguageSelectorPanelComponent {
822
784
  .subscribe();
823
785
  }
824
786
  }
825
- static ɵfac = function LanguageSelectorPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguageSelectorPanelComponent)(); };
826
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguageSelectorPanelComponent, selectors: [["lib-language-selector-panel"]], hostAttrs: [1, "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]", 2, "background-color", "var(--surface-overlay)", "inset-inline-end", "0"], decls: 3, vars: 0, consts: [[1, "flex", "flex-col"], ["type", "button", 1, "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", 3, "bg-primary-50", "text-primary"], ["type", "button", 1, "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", 3, "click"], [1, "font-medium", "flex-1"], [1, "text-xs", "text-muted-color", "uppercase"], [1, "pi", "pi-check", "text-primary", "text-sm"]], template: function LanguageSelectorPanelComponent_Template(rf, ctx) { if (rf & 1) {
827
- i0.ɵɵdomElementStart(0, "div", 0);
828
- i0.ɵɵrepeaterCreate(1, LanguageSelectorPanelComponent_For_2_Template, 6, 7, "button", 1, _forTrack0$2);
829
- i0.ɵɵdomElementEnd();
830
- } if (rf & 2) {
831
- i0.ɵɵadvance();
832
- i0.ɵɵrepeater(ctx.languages());
833
- } }, encapsulation: 2 });
787
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageSelectorPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
788
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", 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: `
789
+ <div class="flex flex-col">
790
+ @for (lang of languages(); track lang.id) {
791
+ <button
792
+ type="button"
793
+ 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"
794
+ [class.bg-primary-50]="lang.code === selectedLanguageCode()"
795
+ [class.text-primary]="lang.code === selectedLanguageCode()"
796
+ (click)="onLanguageSelect(lang.code)">
797
+ <span class="font-medium flex-1">{{ lang.nativeName || lang.name }}</span>
798
+ <span class="text-xs text-muted-color uppercase">({{ lang.code }})</span>
799
+ @if (lang.code === selectedLanguageCode()) {
800
+ <i class="pi pi-check text-primary text-sm"></i>
801
+ }
802
+ </button>
803
+ }
804
+ </div>
805
+ `, isInline: true });
834
806
  }
835
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageSelectorPanelComponent, [{
836
- type: Component,
837
- args: [{
838
- selector: 'lib-language-selector-panel',
839
- imports: [],
840
- host: {
841
- 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]',
842
- style: 'background-color: var(--surface-overlay); inset-inline-end: 0;',
843
- },
844
- template: `
807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageSelectorPanelComponent, decorators: [{
808
+ type: Component,
809
+ args: [{
810
+ selector: 'lib-language-selector-panel',
811
+ imports: [],
812
+ host: {
813
+ 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]',
814
+ style: 'background-color: var(--surface-overlay); inset-inline-end: 0;',
815
+ },
816
+ template: `
845
817
  <div class="flex flex-col">
846
818
  @for (lang of languages(); track lang.id) {
847
819
  <button
@@ -859,9 +831,8 @@ class LanguageSelectorPanelComponent {
859
831
  }
860
832
  </div>
861
833
  `,
862
- }]
863
- }], () => [], null); })();
864
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguageSelectorPanelComponent, { className: "LanguageSelectorPanelComponent", filePath: "components/language-selector-panel/language-selector-panel.component.ts", lineNumber: 33 }); })();
834
+ }]
835
+ }], ctorParameters: () => [] });
865
836
 
866
837
  function provideLocalization(config) {
867
838
  const providers = [
@@ -927,22 +898,6 @@ const LOCALIZATION_ROUTES = [
927
898
  },
928
899
  ];
929
900
 
930
- const _forTrack0$1 = ($index, $item) => $item.id;
931
- function LocalizationContainerPage_For_10_Template(rf, ctx) { if (rf & 1) {
932
- i0.ɵɵelementStart(0, "a", 5);
933
- i0.ɵɵelement(1, "i");
934
- i0.ɵɵelementStart(2, "span");
935
- i0.ɵɵtext(3);
936
- i0.ɵɵpipe(4, "translate");
937
- i0.ɵɵelementEnd()();
938
- } if (rf & 2) {
939
- const tab_r1 = ctx.$implicit;
940
- i0.ɵɵproperty("routerLink", tab_r1.route);
941
- i0.ɵɵadvance();
942
- i0.ɵɵclassMap(tab_r1.icon);
943
- i0.ɵɵadvance(2);
944
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 4, tab_r1.labelKey));
945
- } }
946
901
  class LocalizationContainerPage {
947
902
  permissionValidator = inject(PermissionValidatorService);
948
903
  allTabs = [
@@ -975,33 +930,34 @@ class LocalizationContainerPage {
975
930
  return [];
976
931
  return this.allTabs.filter((tab) => this.permissionValidator.hasPermission(tab.permission));
977
932
  }, ...(ngDevMode ? [{ debugName: "visibleTabs" }] : []));
978
- static ɵfac = function LocalizationContainerPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalizationContainerPage)(); };
979
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LocalizationContainerPage, selectors: [["lib-localization-container"]], decls: 12, vars: 6, consts: [[1, "p-2", "sm:p-4"], [1, "mb-4"], [1, "text-xl", "sm:text-2xl", "font-bold", "m-0"], [1, "text-muted-color", "mt-1", "text-sm", "sm:text-base"], [1, "scrollbar-hide", "flex", "gap-1", "mb-4", "border-b", "border-surface", "overflow-x-auto", "flex-nowrap"], ["routerLinkActive", "tab-active", 1, "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", 3, "routerLink"]], template: function LocalizationContainerPage_Template(rf, ctx) { if (rf & 1) {
980
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h1", 2);
981
- i0.ɵɵtext(3);
982
- i0.ɵɵpipe(4, "translate");
983
- i0.ɵɵelementEnd();
984
- i0.ɵɵelementStart(5, "p", 3);
985
- i0.ɵɵtext(6);
986
- i0.ɵɵpipe(7, "translate");
987
- i0.ɵɵelementEnd()();
988
- i0.ɵɵelementStart(8, "div", 4);
989
- i0.ɵɵrepeaterCreate(9, LocalizationContainerPage_For_10_Template, 5, 6, "a", 5, _forTrack0$1);
990
- i0.ɵɵelementEnd();
991
- i0.ɵɵelement(11, "router-outlet");
992
- i0.ɵɵelementEnd();
993
- } if (rf & 2) {
994
- i0.ɵɵadvance(3);
995
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 2, "localization.title"));
996
- i0.ɵɵadvance(3);
997
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 4, "localization.subtitle"));
998
- i0.ɵɵadvance(3);
999
- i0.ɵɵrepeater(ctx.visibleTabs());
1000
- } }, dependencies: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], styles: [".scrollbar-hide[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"] });
933
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationContainerPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
934
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: LocalizationContainerPage, isStandalone: true, selector: "lib-localization-container", ngImport: i0, template: `
935
+ <div class="p-2 sm:p-4">
936
+ <div class="mb-4">
937
+ <h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
938
+ <p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'localization.subtitle' | translate }}</p>
939
+ </div>
940
+
941
+ <div class="scrollbar-hide flex gap-1 mb-4 border-b border-surface overflow-x-auto flex-nowrap">
942
+ @for (tab of visibleTabs(); track tab.id) {
943
+ <a
944
+ [routerLink]="tab.route"
945
+ routerLinkActive="tab-active"
946
+ 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"
947
+ >
948
+ <i [class]="tab.icon"></i>
949
+ <span>{{ tab.labelKey | translate }}</span>
950
+ </a>
951
+ }
952
+ </div>
953
+
954
+ <router-outlet />
955
+ </div>
956
+ `, 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" }] });
1001
957
  }
1002
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalizationContainerPage, [{
1003
- type: Component,
1004
- args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], template: `
958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LocalizationContainerPage, decorators: [{
959
+ type: Component,
960
+ args: [{ selector: 'lib-localization-container', imports: [RouterOutlet, RouterLink, RouterLinkActive, TranslatePipe], template: `
1005
961
  <div class="p-2 sm:p-4">
1006
962
  <div class="mb-4">
1007
963
  <h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'localization.title' | translate }}</h1>
@@ -1024,160 +980,13 @@ class LocalizationContainerPage {
1024
980
  <router-outlet />
1025
981
  </div>
1026
982
  `, styles: [".scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}\n"] }]
1027
- }], null, null); })();
1028
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LocalizationContainerPage, { className: "LocalizationContainerPage", filePath: "pages/localization-container/localization-container.page.ts", lineNumber: 53 }); })();
983
+ }] });
1029
984
 
1030
985
  var localizationContainer_page = /*#__PURE__*/Object.freeze({
1031
986
  __proto__: null,
1032
987
  LocalizationContainerPage: LocalizationContainerPage
1033
988
  });
1034
989
 
1035
- const _c0$4 = () => ({ "min-width": "40rem" });
1036
- function LanguageListPage_p_button_9_Template(rf, ctx) { if (rf & 1) {
1037
- const _r1 = i0.ɵɵgetCurrentView();
1038
- i0.ɵɵelementStart(0, "p-button", 10);
1039
- i0.ɵɵpipe(1, "translate");
1040
- i0.ɵɵlistener("onClick", function LanguageListPage_p_button_9_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCreate()); });
1041
- i0.ɵɵelementEnd();
1042
- } if (rf & 2) {
1043
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(1, 1, "localization.language.create"));
1044
- } }
1045
- function LanguageListPage_ng_template_12_Template(rf, ctx) { if (rf & 1) {
1046
- i0.ɵɵelementStart(0, "tr")(1, "th");
1047
- i0.ɵɵtext(2);
1048
- i0.ɵɵpipe(3, "translate");
1049
- i0.ɵɵelementEnd();
1050
- i0.ɵɵelementStart(4, "th");
1051
- i0.ɵɵtext(5);
1052
- i0.ɵɵpipe(6, "translate");
1053
- i0.ɵɵelementEnd();
1054
- i0.ɵɵelementStart(7, "th");
1055
- i0.ɵɵtext(8);
1056
- i0.ɵɵpipe(9, "translate");
1057
- i0.ɵɵelementEnd();
1058
- i0.ɵɵelementStart(10, "th");
1059
- i0.ɵɵtext(11);
1060
- i0.ɵɵpipe(12, "translate");
1061
- i0.ɵɵelementEnd();
1062
- i0.ɵɵelementStart(13, "th");
1063
- i0.ɵɵtext(14);
1064
- i0.ɵɵpipe(15, "translate");
1065
- i0.ɵɵelementEnd();
1066
- i0.ɵɵelementStart(16, "th", 11);
1067
- i0.ɵɵtext(17);
1068
- i0.ɵɵpipe(18, "translate");
1069
- i0.ɵɵelementEnd()();
1070
- } if (rf & 2) {
1071
- i0.ɵɵadvance(2);
1072
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "localization.language.code"));
1073
- i0.ɵɵadvance(3);
1074
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 8, "localization.language.name"));
1075
- i0.ɵɵadvance(3);
1076
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 10, "localization.language.native.name"));
1077
- i0.ɵɵadvance(3);
1078
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 12, "localization.language.direction"));
1079
- i0.ɵɵadvance(3);
1080
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 14, "shared.status"));
1081
- i0.ɵɵadvance(3);
1082
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 16, "shared.actions"));
1083
- } }
1084
- function LanguageListPage_ng_template_14_Conditional_18_Template(rf, ctx) { if (rf & 1) {
1085
- i0.ɵɵelement(0, "p-tag", 15);
1086
- i0.ɵɵpipe(1, "translate");
1087
- } if (rf & 2) {
1088
- i0.ɵɵproperty("value", i0.ɵɵpipeBind1(1, 1, "localization.language.default"));
1089
- } }
1090
- function LanguageListPage_ng_template_14_Conditional_21_p_button_0_Template(rf, ctx) { if (rf & 1) {
1091
- const _r3 = i0.ɵɵgetCurrentView();
1092
- i0.ɵɵelementStart(0, "p-button", 21);
1093
- i0.ɵɵpipe(1, "translate");
1094
- i0.ɵɵlistener("onClick", function LanguageListPage_ng_template_14_Conditional_21_p_button_0_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r3); const lang_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSetDefault(lang_r4)); });
1095
- i0.ɵɵelementEnd();
1096
- } if (rf & 2) {
1097
- i0.ɵɵproperty("text", true)("pTooltip", i0.ɵɵpipeBind1(1, 2, "localization.language.set.default"));
1098
- } }
1099
- function LanguageListPage_ng_template_14_Conditional_21_Template(rf, ctx) { if (rf & 1) {
1100
- i0.ɵɵtemplate(0, LanguageListPage_ng_template_14_Conditional_21_p_button_0_Template, 2, 4, "p-button", 20);
1101
- } if (rf & 2) {
1102
- const ctx_r1 = i0.ɵɵnextContext(2);
1103
- i0.ɵɵproperty("hasPermission", ctx_r1.LANGUAGE_PERMISSIONS.UPDATE);
1104
- } }
1105
- function LanguageListPage_ng_template_14_p_button_22_Template(rf, ctx) { if (rf & 1) {
1106
- const _r5 = i0.ɵɵgetCurrentView();
1107
- i0.ɵɵelementStart(0, "p-button", 22);
1108
- i0.ɵɵpipe(1, "translate");
1109
- i0.ɵɵlistener("onClick", function LanguageListPage_ng_template_14_p_button_22_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r5); const lang_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEdit(lang_r4.id)); });
1110
- i0.ɵɵelementEnd();
1111
- } if (rf & 2) {
1112
- i0.ɵɵproperty("text", true)("pTooltip", i0.ɵɵpipeBind1(1, 2, "shared.edit"));
1113
- } }
1114
- function LanguageListPage_ng_template_14_p_button_23_Template(rf, ctx) { if (rf & 1) {
1115
- const _r6 = i0.ɵɵgetCurrentView();
1116
- i0.ɵɵelementStart(0, "p-button", 23);
1117
- i0.ɵɵpipe(1, "translate");
1118
- i0.ɵɵlistener("onClick", function LanguageListPage_ng_template_14_p_button_23_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r6); const lang_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onDelete(lang_r4)); });
1119
- i0.ɵɵelementEnd();
1120
- } if (rf & 2) {
1121
- const lang_r4 = i0.ɵɵnextContext().$implicit;
1122
- i0.ɵɵproperty("text", true)("pTooltip", i0.ɵɵpipeBind1(1, 3, "shared.delete"))("disabled", lang_r4.isDefault);
1123
- } }
1124
- function LanguageListPage_ng_template_14_Template(rf, ctx) { if (rf & 1) {
1125
- i0.ɵɵelementStart(0, "tr")(1, "td")(2, "span", 12);
1126
- i0.ɵɵtext(3);
1127
- i0.ɵɵelementEnd()();
1128
- i0.ɵɵelementStart(4, "td");
1129
- i0.ɵɵtext(5);
1130
- i0.ɵɵelementEnd();
1131
- i0.ɵɵelementStart(6, "td");
1132
- i0.ɵɵtext(7);
1133
- i0.ɵɵpipe(8, "translate");
1134
- i0.ɵɵelementEnd();
1135
- i0.ɵɵelementStart(9, "td");
1136
- i0.ɵɵelement(10, "p-tag", 13);
1137
- i0.ɵɵpipe(11, "translate");
1138
- i0.ɵɵpipe(12, "translate");
1139
- i0.ɵɵelementEnd();
1140
- i0.ɵɵelementStart(13, "td")(14, "div", 14);
1141
- i0.ɵɵelement(15, "p-tag", 13);
1142
- i0.ɵɵpipe(16, "translate");
1143
- i0.ɵɵpipe(17, "translate");
1144
- i0.ɵɵconditionalCreate(18, LanguageListPage_ng_template_14_Conditional_18_Template, 2, 3, "p-tag", 15);
1145
- i0.ɵɵelementEnd()();
1146
- i0.ɵɵelementStart(19, "td")(20, "div", 16);
1147
- i0.ɵɵconditionalCreate(21, LanguageListPage_ng_template_14_Conditional_21_Template, 1, 1, "p-button", 17);
1148
- i0.ɵɵtemplate(22, LanguageListPage_ng_template_14_p_button_22_Template, 2, 4, "p-button", 18)(23, LanguageListPage_ng_template_14_p_button_23_Template, 2, 5, "p-button", 19);
1149
- i0.ɵɵelementEnd()()();
1150
- } if (rf & 2) {
1151
- const lang_r4 = ctx.$implicit;
1152
- const ctx_r1 = i0.ɵɵnextContext();
1153
- i0.ɵɵadvance(3);
1154
- i0.ɵɵtextInterpolate(lang_r4.code);
1155
- i0.ɵɵadvance(2);
1156
- i0.ɵɵtextInterpolate(lang_r4.name);
1157
- i0.ɵɵadvance(2);
1158
- i0.ɵɵtextInterpolate(lang_r4.nativeName || i0.ɵɵpipeBind1(8, 11, "shared.na"));
1159
- i0.ɵɵadvance(3);
1160
- i0.ɵɵproperty("value", lang_r4.direction === "rtl" ? i0.ɵɵpipeBind1(11, 13, "localization.language.rtl") : i0.ɵɵpipeBind1(12, 15, "localization.language.ltr"))("severity", lang_r4.direction === "rtl" ? "warn" : "info");
1161
- i0.ɵɵadvance(5);
1162
- i0.ɵɵproperty("value", lang_r4.isActive ? i0.ɵɵpipeBind1(16, 17, "shared.active") : i0.ɵɵpipeBind1(17, 19, "shared.inactive"))("severity", lang_r4.isActive ? "success" : "secondary");
1163
- i0.ɵɵadvance(3);
1164
- i0.ɵɵconditional(lang_r4.isDefault ? 18 : -1);
1165
- i0.ɵɵadvance(3);
1166
- i0.ɵɵconditional(!lang_r4.isDefault ? 21 : -1);
1167
- i0.ɵɵadvance();
1168
- i0.ɵɵproperty("hasPermission", ctx_r1.LANGUAGE_PERMISSIONS.UPDATE);
1169
- i0.ɵɵadvance();
1170
- i0.ɵɵproperty("hasPermission", ctx_r1.LANGUAGE_PERMISSIONS.DELETE);
1171
- } }
1172
- function LanguageListPage_ng_template_16_Template(rf, ctx) { if (rf & 1) {
1173
- i0.ɵɵelementStart(0, "tr")(1, "td", 24);
1174
- i0.ɵɵtext(2);
1175
- i0.ɵɵpipe(3, "translate");
1176
- i0.ɵɵelementEnd()();
1177
- } if (rf & 2) {
1178
- i0.ɵɵadvance(2);
1179
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "localization.language.empty"), " ");
1180
- } }
1181
990
  class LanguageListPage {
1182
991
  LANGUAGE_PERMISSIONS = LANGUAGE_PERMISSIONS;
1183
992
  router = inject(Router);
@@ -1260,40 +1069,125 @@ class LanguageListPage {
1260
1069
  },
1261
1070
  });
1262
1071
  }
1263
- static ɵfac = function LanguageListPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguageListPage)(); };
1264
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguageListPage, selectors: [["lib-language-list-page"]], features: [i0.ɵɵProvidersFeature([ConfirmationService, MessageService])], decls: 20, vars: 11, consts: [["header", ""], ["body", ""], ["emptymessage", ""], [1, "card"], [1, "flex", "flex-col", "sm:flex-row", "justify-between", "items-start", "sm:items-center", "gap-3", "mb-4"], [1, "text-lg", "sm:text-xl", "font-semibold", "m-0"], [1, "text-sm", "text-muted-color", "mt-1"], ["icon", "pi pi-plus", "styleClass", "w-full sm:w-auto", 3, "label", "onClick", 4, "hasPermission"], [1, "overflow-x-auto", "-mx-4", "sm:mx-0"], ["styleClass", "p-datatable-sm", 3, "value", "loading", "tableStyle"], ["icon", "pi pi-plus", "styleClass", "w-full sm:w-auto", 3, "onClick", "label"], [1, "w-[150px]"], [1, "uppercase", "font-semibold"], [3, "value", "severity"], [1, "flex", "gap-1", "items-center"], ["severity", "contrast", 3, "value"], [1, "flex", "gap-1"], ["icon", "pi pi-star", "size", "small", 3, "text", "pTooltip"], ["icon", "pi pi-pencil", "severity", "secondary", "size", "small", 3, "text", "pTooltip", "onClick", 4, "hasPermission"], ["icon", "pi pi-trash", "severity", "danger", "size", "small", 3, "text", "pTooltip", "disabled", "onClick", 4, "hasPermission"], ["icon", "pi pi-star", "size", "small", 3, "text", "pTooltip", "onClick", 4, "hasPermission"], ["icon", "pi pi-star", "size", "small", 3, "onClick", "text", "pTooltip"], ["icon", "pi pi-pencil", "severity", "secondary", "size", "small", 3, "onClick", "text", "pTooltip"], ["icon", "pi pi-trash", "severity", "danger", "size", "small", 3, "onClick", "text", "pTooltip", "disabled"], ["colspan", "6", 1, "text-center", "py-4", "text-muted-color"]], template: function LanguageListPage_Template(rf, ctx) { if (rf & 1) {
1265
- i0.ɵɵelementStart(0, "div", 3)(1, "div", 4)(2, "div")(3, "h3", 5);
1266
- i0.ɵɵtext(4);
1267
- i0.ɵɵpipe(5, "translate");
1268
- i0.ɵɵelementEnd();
1269
- i0.ɵɵelementStart(6, "p", 6);
1270
- i0.ɵɵtext(7);
1271
- i0.ɵɵpipe(8, "translate");
1272
- i0.ɵɵelementEnd()();
1273
- i0.ɵɵtemplate(9, LanguageListPage_p_button_9_Template, 2, 3, "p-button", 7);
1274
- i0.ɵɵelementEnd();
1275
- i0.ɵɵelementStart(10, "div", 8)(11, "p-table", 9);
1276
- i0.ɵɵtemplate(12, LanguageListPage_ng_template_12_Template, 19, 18, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(14, LanguageListPage_ng_template_14_Template, 24, 21, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(16, LanguageListPage_ng_template_16_Template, 4, 3, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
1277
- i0.ɵɵelementEnd()()();
1278
- i0.ɵɵelement(18, "p-confirmDialog")(19, "p-toast");
1279
- } if (rf & 2) {
1280
- i0.ɵɵadvance(4);
1281
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 6, "localization.language.title"));
1282
- i0.ɵɵadvance(3);
1283
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 8, "localization.language.subtitle"), " ");
1284
- i0.ɵɵadvance(2);
1285
- i0.ɵɵproperty("hasPermission", ctx.LANGUAGE_PERMISSIONS.CREATE);
1286
- i0.ɵɵadvance(2);
1287
- i0.ɵɵproperty("value", ctx.languages())("loading", ctx.isLoading())("tableStyle", i0.ɵɵpureFunction0(10, _c0$4));
1288
- } }, dependencies: [AngularModule, PrimeModule, i2.Button, i2$1.ConfirmDialog, i8.Table, i4.Tag, i10.Toast, i6.Tooltip, HasPermissionDirective, TranslatePipe], encapsulation: 2 });
1072
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1073
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: LanguageListPage, isStandalone: true, selector: "lib-language-list-page", providers: [ConfirmationService, MessageService], ngImport: i0, template: `
1074
+ <div class="card">
1075
+ <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
1076
+ <div>
1077
+ <h3 class="text-lg sm:text-xl font-semibold m-0">{{ 'localization.language.title' | translate }}</h3>
1078
+ <p class="text-sm text-muted-color mt-1">
1079
+ {{ 'localization.language.subtitle' | translate }}
1080
+ </p>
1081
+ </div>
1082
+ <p-button
1083
+ *hasPermission="LANGUAGE_PERMISSIONS.CREATE"
1084
+ [label]="'localization.language.create' | translate"
1085
+ icon="pi pi-plus"
1086
+ (onClick)="onCreate()"
1087
+ styleClass="w-full sm:w-auto"
1088
+ />
1089
+ </div>
1090
+
1091
+ <div class="overflow-x-auto -mx-4 sm:mx-0">
1092
+ <p-table
1093
+ [value]="languages()"
1094
+ [loading]="isLoading()"
1095
+ styleClass="p-datatable-sm"
1096
+ [tableStyle]="{ 'min-width': '40rem' }"
1097
+ >
1098
+ <ng-template #header>
1099
+ <tr>
1100
+ <th>{{ 'localization.language.code' | translate }}</th>
1101
+ <th>{{ 'localization.language.name' | translate }}</th>
1102
+ <th>{{ 'localization.language.native.name' | translate }}</th>
1103
+ <th>{{ 'localization.language.direction' | translate }}</th>
1104
+ <th>{{ 'shared.status' | translate }}</th>
1105
+ <th class="w-[150px]">{{ 'shared.actions' | translate }}</th>
1106
+ </tr>
1107
+ </ng-template>
1108
+
1109
+ <ng-template #body let-lang>
1110
+ <tr>
1111
+ <td>
1112
+ <span class="uppercase font-semibold">{{ lang.code }}</span>
1113
+ </td>
1114
+ <td>{{ lang.name }}</td>
1115
+ <td>{{ lang.nativeName || ('shared.na' | translate) }}</td>
1116
+ <td>
1117
+ <p-tag
1118
+ [value]="lang.direction === 'rtl' ? ('localization.language.rtl' | translate) : ('localization.language.ltr' | translate)"
1119
+ [severity]="lang.direction === 'rtl' ? 'warn' : 'info'"
1120
+ />
1121
+ </td>
1122
+ <td>
1123
+ <div class="flex gap-1 items-center">
1124
+ <p-tag
1125
+ [value]="lang.isActive ? ('shared.active' | translate) : ('shared.inactive' | translate)"
1126
+ [severity]="lang.isActive ? 'success' : 'secondary'"
1127
+ />
1128
+ @if (lang.isDefault) {
1129
+ <p-tag [value]="'localization.language.default' | translate" severity="contrast" />
1130
+ }
1131
+ </div>
1132
+ </td>
1133
+ <td>
1134
+ <div class="flex gap-1">
1135
+ @if (!lang.isDefault) {
1136
+ <p-button
1137
+ *hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
1138
+ icon="pi pi-star"
1139
+ [text]="true"
1140
+ size="small"
1141
+ [pTooltip]="'localization.language.set.default' | translate"
1142
+ (onClick)="onSetDefault(lang)"
1143
+ />
1144
+ }
1145
+ <p-button
1146
+ *hasPermission="LANGUAGE_PERMISSIONS.UPDATE"
1147
+ icon="pi pi-pencil"
1148
+ [text]="true"
1149
+ severity="secondary"
1150
+ size="small"
1151
+ [pTooltip]="'shared.edit' | translate"
1152
+ (onClick)="onEdit(lang.id)"
1153
+ />
1154
+ <p-button
1155
+ *hasPermission="LANGUAGE_PERMISSIONS.DELETE"
1156
+ icon="pi pi-trash"
1157
+ [text]="true"
1158
+ severity="danger"
1159
+ size="small"
1160
+ [pTooltip]="'shared.delete' | translate"
1161
+ [disabled]="lang.isDefault"
1162
+ (onClick)="onDelete(lang)"
1163
+ />
1164
+ </div>
1165
+ </td>
1166
+ </tr>
1167
+ </ng-template>
1168
+
1169
+ <ng-template #emptymessage>
1170
+ <tr>
1171
+ <td colspan="6" class="text-center py-4 text-muted-color">
1172
+ {{ 'localization.language.empty' | translate }}
1173
+ </td>
1174
+ </tr>
1175
+ </ng-template>
1176
+ </p-table>
1177
+ </div>
1178
+ </div>
1179
+
1180
+ <p-confirmDialog />
1181
+ <p-toast />
1182
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { 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: i2$1.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i4.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
1289
1183
  }
1290
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageListPage, [{
1291
- type: Component,
1292
- args: [{
1293
- selector: 'lib-language-list-page',
1294
- imports: [AngularModule, PrimeModule, HasPermissionDirective, TranslatePipe],
1295
- providers: [ConfirmationService, MessageService],
1296
- template: `
1184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageListPage, decorators: [{
1185
+ type: Component,
1186
+ args: [{
1187
+ selector: 'lib-language-list-page',
1188
+ imports: [AngularModule, PrimeModule, HasPermissionDirective, TranslatePipe],
1189
+ providers: [ConfirmationService, MessageService],
1190
+ template: `
1297
1191
  <div class="card">
1298
1192
  <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
1299
1193
  <div>
@@ -1403,27 +1297,14 @@ class LanguageListPage {
1403
1297
  <p-confirmDialog />
1404
1298
  <p-toast />
1405
1299
  `,
1406
- }]
1407
- }], null, null); })();
1408
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguageListPage, { className: "LanguageListPage", filePath: "pages/language-list/language-list.page.ts", lineNumber: 131 }); })();
1300
+ }]
1301
+ }] });
1409
1302
 
1410
1303
  var languageList_page = /*#__PURE__*/Object.freeze({
1411
1304
  __proto__: null,
1412
1305
  LanguageListPage: LanguageListPage
1413
1306
  });
1414
1307
 
1415
- const _c0$3 = () => ({ standalone: true });
1416
- function LanguageFormPage_ng_template_1_Template(rf, ctx) { if (rf & 1) {
1417
- i0.ɵɵelementStart(0, "div", 21)(1, "h2", 22);
1418
- i0.ɵɵtext(2);
1419
- i0.ɵɵpipe(3, "translate");
1420
- i0.ɵɵpipe(4, "translate");
1421
- i0.ɵɵelementEnd()();
1422
- } if (rf & 2) {
1423
- const ctx_r1 = i0.ɵɵnextContext();
1424
- i0.ɵɵadvance(2);
1425
- i0.ɵɵtextInterpolate1(" ", ctx_r1.isEditMode() ? i0.ɵɵpipeBind1(3, 1, "localization.language.edit") : i0.ɵɵpipeBind1(4, 3, "localization.language.create"), " ");
1426
- } }
1427
1308
  class LanguageFormPage {
1428
1309
  router = inject(Router);
1429
1310
  route = inject(ActivatedRoute);
@@ -1537,132 +1418,8 @@ class LanguageFormPage {
1537
1418
  onCancel() {
1538
1419
  this.router.navigate(['/localization/languages']);
1539
1420
  }
1540
- static ɵfac = function LanguageFormPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguageFormPage)(); };
1541
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguageFormPage, selectors: [["lib-language-form-page"]], features: [i0.ɵɵProvidersFeature([MessageService])], decls: 58, vars: 66, consts: [["header", ""], [1, "grid", "grid-cols-1", "md:grid-cols-2", "gap-4", 3, "ngSubmit"], [1, "flex", "flex-col", "gap-2"], ["for", "code", 1, "font-medium"], ["pInputText", "", "id", "code", 3, "formField", "placeholder"], [1, "text-muted-color"], ["for", "name", 1, "font-medium"], ["pInputText", "", "id", "name", 3, "formField", "placeholder"], ["for", "nativeName", 1, "font-medium"], ["pInputText", "", "id", "nativeName", 3, "formField", "placeholder"], ["for", "direction", 1, "font-medium"], ["id", "direction", "optionLabel", "label", "optionValue", "value", 1, "w-full", 3, "ngModelChange", "ngModel", "ngModelOptions", "options"], ["for", "serial", 1, "font-medium"], ["pInputText", "", "id", "serial", "type", "number", 3, "formField", "placeholder"], [1, "hidden", "md:block"], [1, "flex", "items-center", "gap-6", "md:col-span-2", "pt-4"], [1, "p-checkbox-native"], ["type", "checkbox", 3, "formField"], [1, "flex", "justify-end", "gap-4", "md:col-span-2", "pt-4"], ["severity", "secondary", 3, "onClick", "label", "outlined"], ["type", "submit", 3, "label", "loading", "disabled"], [1, "flex", "justify-between", "items-center", "p-4"], [1, "text-xl", "font-semibold", "m-0"]], template: function LanguageFormPage_Template(rf, ctx) { if (rf & 1) {
1542
- const _r1 = i0.ɵɵgetCurrentView();
1543
- i0.ɵɵelementStart(0, "p-card");
1544
- i0.ɵɵtemplate(1, LanguageFormPage_ng_template_1_Template, 5, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
1545
- i0.ɵɵelementStart(3, "form", 1);
1546
- i0.ɵɵlistener("ngSubmit", function LanguageFormPage_Template_form_ngSubmit_3_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onSubmit()); });
1547
- i0.ɵɵelementStart(4, "div", 2)(5, "label", 3);
1548
- i0.ɵɵtext(6);
1549
- i0.ɵɵpipe(7, "translate");
1550
- i0.ɵɵelementEnd();
1551
- i0.ɵɵelement(8, "input", 4);
1552
- i0.ɵɵpipe(9, "translate");
1553
- i0.ɵɵcontrolCreate();
1554
- i0.ɵɵelementStart(10, "small", 5);
1555
- i0.ɵɵtext(11);
1556
- i0.ɵɵpipe(12, "translate");
1557
- i0.ɵɵelementEnd()();
1558
- i0.ɵɵelementStart(13, "div", 2)(14, "label", 6);
1559
- i0.ɵɵtext(15);
1560
- i0.ɵɵpipe(16, "translate");
1561
- i0.ɵɵelementEnd();
1562
- i0.ɵɵelement(17, "input", 7);
1563
- i0.ɵɵpipe(18, "translate");
1564
- i0.ɵɵcontrolCreate();
1565
- i0.ɵɵelementEnd();
1566
- i0.ɵɵelementStart(19, "div", 2)(20, "label", 8);
1567
- i0.ɵɵtext(21);
1568
- i0.ɵɵpipe(22, "translate");
1569
- i0.ɵɵelementEnd();
1570
- i0.ɵɵelement(23, "input", 9);
1571
- i0.ɵɵpipe(24, "translate");
1572
- i0.ɵɵcontrolCreate();
1573
- i0.ɵɵelementStart(25, "small", 5);
1574
- i0.ɵɵtext(26);
1575
- i0.ɵɵpipe(27, "translate");
1576
- i0.ɵɵelementEnd()();
1577
- i0.ɵɵelementStart(28, "div", 2)(29, "label", 10);
1578
- i0.ɵɵtext(30);
1579
- i0.ɵɵpipe(31, "translate");
1580
- i0.ɵɵelementEnd();
1581
- i0.ɵɵelementStart(32, "p-select", 11);
1582
- i0.ɵɵlistener("ngModelChange", function LanguageFormPage_Template_p_select_ngModelChange_32_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.updateDirection($event)); });
1583
- i0.ɵɵelementEnd()();
1584
- i0.ɵɵelementStart(33, "div", 2)(34, "label", 12);
1585
- i0.ɵɵtext(35);
1586
- i0.ɵɵpipe(36, "translate");
1587
- i0.ɵɵelementEnd();
1588
- i0.ɵɵelement(37, "input", 13);
1589
- i0.ɵɵpipe(38, "translate");
1590
- i0.ɵɵcontrolCreate();
1591
- i0.ɵɵelementEnd();
1592
- i0.ɵɵelement(39, "div", 14);
1593
- i0.ɵɵelementStart(40, "div", 15)(41, "label", 16);
1594
- i0.ɵɵelement(42, "input", 17);
1595
- i0.ɵɵcontrolCreate();
1596
- i0.ɵɵelementStart(43, "span");
1597
- i0.ɵɵtext(44);
1598
- i0.ɵɵpipe(45, "translate");
1599
- i0.ɵɵelementEnd()();
1600
- i0.ɵɵelementStart(46, "label", 16);
1601
- i0.ɵɵelement(47, "input", 17);
1602
- i0.ɵɵcontrolCreate();
1603
- i0.ɵɵelementStart(48, "span");
1604
- i0.ɵɵtext(49);
1605
- i0.ɵɵpipe(50, "translate");
1606
- i0.ɵɵelementEnd()()();
1607
- i0.ɵɵelementStart(51, "div", 18)(52, "p-button", 19);
1608
- i0.ɵɵpipe(53, "translate");
1609
- i0.ɵɵlistener("onClick", function LanguageFormPage_Template_p_button_onClick_52_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onCancel()); });
1610
- i0.ɵɵelementEnd();
1611
- i0.ɵɵelement(54, "p-button", 20);
1612
- i0.ɵɵpipe(55, "translate");
1613
- i0.ɵɵpipe(56, "translate");
1614
- i0.ɵɵelementEnd()()();
1615
- i0.ɵɵelement(57, "p-toast");
1616
- } if (rf & 2) {
1617
- i0.ɵɵadvance(6);
1618
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(7, 33, "localization.language.code"), " *");
1619
- i0.ɵɵadvance(2);
1620
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(9, 35, "localization.placeholder.code"));
1621
- i0.ɵɵcontrol(ctx.formTree.code, "formField");
1622
- i0.ɵɵadvance(3);
1623
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 37, "localization.language.iso.code.hint"));
1624
- i0.ɵɵadvance(4);
1625
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(16, 39, "localization.language.name"), " *");
1626
- i0.ɵɵadvance(2);
1627
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(18, 41, "localization.placeholder.name"));
1628
- i0.ɵɵcontrol(ctx.formTree.name, "formField");
1629
- i0.ɵɵadvance(4);
1630
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 43, "localization.language.native.name"));
1631
- i0.ɵɵadvance(2);
1632
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(24, 45, "localization.placeholder.native.name"));
1633
- i0.ɵɵcontrol(ctx.formTree.nativeName, "formField");
1634
- i0.ɵɵadvance(3);
1635
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(27, 47, "localization.language.native.name.hint"));
1636
- i0.ɵɵadvance(4);
1637
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(31, 49, "localization.language.direction"), " *");
1638
- i0.ɵɵadvance(2);
1639
- i0.ɵɵproperty("ngModel", ctx.formModel().direction)("ngModelOptions", i0.ɵɵpureFunction0(65, _c0$3))("options", ctx.directionOptions());
1640
- i0.ɵɵadvance(3);
1641
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 51, "localization.language.display.order"));
1642
- i0.ɵɵadvance(2);
1643
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(38, 53, "shared.display.order.placeholder"));
1644
- i0.ɵɵcontrol(ctx.formTree.serial, "formField");
1645
- i0.ɵɵadvance(5);
1646
- i0.ɵɵcontrol(ctx.formTree.isActive, "formField");
1647
- i0.ɵɵadvance(2);
1648
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 55, "shared.active"));
1649
- i0.ɵɵadvance(3);
1650
- i0.ɵɵcontrol(ctx.formTree.isDefault, "formField");
1651
- i0.ɵɵadvance(2);
1652
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(50, 57, "localization.language.default"));
1653
- i0.ɵɵadvance(3);
1654
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(53, 59, "shared.cancel"))("outlined", true);
1655
- i0.ɵɵadvance(2);
1656
- i0.ɵɵproperty("label", ctx.isEditMode() ? i0.ɵɵpipeBind1(55, 61, "shared.update") : i0.ɵɵpipeBind1(56, 63, "shared.create"))("loading", ctx.isSaving())("disabled", !ctx.isFormValid() || ctx.isSaving());
1657
- } }, dependencies: [AngularModule, i1$1.ɵNgNoValidate, i1$1.NgControlStatus, i1$1.NgControlStatusGroup, i1$1.NgModel, i1$1.NgForm, PrimeModule, i2.Button, i3.Card, i4$1.InputText, i5.Select, i10.Toast, FormsModule, FormField, TranslatePipe], encapsulation: 2 });
1658
- }
1659
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageFormPage, [{
1660
- type: Component,
1661
- args: [{
1662
- selector: 'lib-language-form-page',
1663
- imports: [AngularModule, PrimeModule, FormsModule, FormField, TranslatePipe],
1664
- providers: [MessageService],
1665
- template: `
1421
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1422
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: LanguageFormPage, isStandalone: true, selector: "lib-language-form-page", providers: [MessageService], ngImport: i0, template: `
1666
1423
  <p-card>
1667
1424
  <ng-template #header>
1668
1425
  <div class="flex justify-between items-center p-4">
@@ -1762,182 +1519,171 @@ class LanguageFormPage {
1762
1519
  </p-card>
1763
1520
 
1764
1521
  <p-toast />
1765
- `,
1766
- }]
1767
- }], () => [], null); })();
1768
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguageFormPage, { className: "LanguageFormPage", filePath: "pages/language-form/language-form.page.ts", lineNumber: 136 }); })();
1522
+ `, 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$1.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: i10.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" }] });
1523
+ }
1524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LanguageFormPage, decorators: [{
1525
+ type: Component,
1526
+ args: [{
1527
+ selector: 'lib-language-form-page',
1528
+ imports: [AngularModule, PrimeModule, FormsModule, FormField, TranslatePipe],
1529
+ providers: [MessageService],
1530
+ template: `
1531
+ <p-card>
1532
+ <ng-template #header>
1533
+ <div class="flex justify-between items-center p-4">
1534
+ <h2 class="text-xl font-semibold m-0">
1535
+ {{ isEditMode() ? ('localization.language.edit' | translate) : ('localization.language.create' | translate) }}
1536
+ </h2>
1537
+ </div>
1538
+ </ng-template>
1769
1539
 
1770
- var languageForm_page = /*#__PURE__*/Object.freeze({
1771
- __proto__: null,
1772
- LanguageFormPage: LanguageFormPage
1773
- });
1540
+ <form (ngSubmit)="onSubmit()" class="grid grid-cols-1 md:grid-cols-2 gap-4">
1541
+ <!-- Language Code -->
1542
+ <div class="flex flex-col gap-2">
1543
+ <label for="code" class="font-medium">{{ 'localization.language.code' | translate }} *</label>
1544
+ <input
1545
+ pInputText
1546
+ id="code"
1547
+ [formField]="formTree.code"
1548
+ [placeholder]="'localization.placeholder.code' | translate" />
1549
+ <small class="text-muted-color">{{ 'localization.language.iso.code.hint' | translate }}</small>
1550
+ </div>
1774
1551
 
1775
- const _c0$2 = () => ({ standalone: true });
1776
- const _c1$1 = () => [10, 15, 25, 50];
1777
- function TranslationKeyListPage_p_button_10_Template(rf, ctx) { if (rf & 1) {
1778
- const _r2 = i0.ɵɵgetCurrentView();
1779
- i0.ɵɵelementStart(0, "p-button", 16);
1780
- i0.ɵɵpipe(1, "translate");
1781
- i0.ɵɵlistener("onClick", function TranslationKeyListPage_p_button_10_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onCreate()); });
1782
- i0.ɵɵelementEnd();
1783
- } if (rf & 2) {
1784
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(1, 1, "localization.key.create"));
1785
- } }
1786
- function TranslationKeyListPage_ng_template_21_Template(rf, ctx) { if (rf & 1) {
1787
- i0.ɵɵelementStart(0, "tr")(1, "th", 17);
1788
- i0.ɵɵtext(2);
1789
- i0.ɵɵpipe(3, "translate");
1790
- i0.ɵɵelementEnd();
1791
- i0.ɵɵelementStart(4, "th", 18);
1792
- i0.ɵɵtext(5);
1793
- i0.ɵɵpipe(6, "translate");
1794
- i0.ɵɵelementEnd();
1795
- i0.ɵɵelementStart(7, "th", 19);
1796
- i0.ɵɵtext(8);
1797
- i0.ɵɵpipe(9, "translate");
1798
- i0.ɵɵelementEnd();
1799
- i0.ɵɵelementStart(10, "th", 20);
1800
- i0.ɵɵtext(11);
1801
- i0.ɵɵpipe(12, "translate");
1802
- i0.ɵɵelementEnd();
1803
- i0.ɵɵelementStart(13, "th", 17);
1804
- i0.ɵɵtext(14);
1805
- i0.ɵɵpipe(15, "translate");
1806
- i0.ɵɵelementEnd()();
1807
- } if (rf & 2) {
1808
- i0.ɵɵadvance(2);
1809
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 5, "localization.key.module"));
1810
- i0.ɵɵadvance(3);
1811
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 7, "localization.key.name"));
1812
- i0.ɵɵadvance(3);
1813
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 9, "localization.key.default.message"));
1814
- i0.ɵɵadvance(3);
1815
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 11, "localization.key.translations"));
1816
- i0.ɵɵadvance(3);
1817
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 13, "shared.actions"));
1818
- } }
1819
- function TranslationKeyListPage_ng_template_23_Conditional_6_Template(rf, ctx) { if (rf & 1) {
1820
- i0.ɵɵelementStart(0, "small", 23);
1821
- i0.ɵɵtext(1);
1822
- i0.ɵɵelementEnd();
1823
- } if (rf & 2) {
1824
- const key_r4 = i0.ɵɵnextContext().$implicit;
1825
- i0.ɵɵadvance();
1826
- i0.ɵɵtextInterpolate(key_r4.description);
1827
- } }
1828
- function TranslationKeyListPage_ng_template_23_p_button_14_Template(rf, ctx) { if (rf & 1) {
1829
- const _r5 = i0.ɵɵgetCurrentView();
1830
- i0.ɵɵelementStart(0, "p-button", 29);
1831
- i0.ɵɵpipe(1, "translate");
1832
- i0.ɵɵlistener("onClick", function TranslationKeyListPage_ng_template_23_p_button_14_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r5); const key_r4 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onEdit(key_r4)); });
1833
- i0.ɵɵelementEnd();
1834
- } if (rf & 2) {
1835
- i0.ɵɵproperty("text", true)("pTooltip", i0.ɵɵpipeBind1(1, 2, "shared.edit"));
1836
- } }
1837
- function TranslationKeyListPage_ng_template_23_p_button_15_Template(rf, ctx) { if (rf & 1) {
1838
- const _r6 = i0.ɵɵgetCurrentView();
1839
- i0.ɵɵelementStart(0, "p-button", 30);
1840
- i0.ɵɵpipe(1, "translate");
1841
- i0.ɵɵlistener("onClick", function TranslationKeyListPage_ng_template_23_p_button_15_Template_p_button_onClick_0_listener() { i0.ɵɵrestoreView(_r6); const key_r4 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onDelete(key_r4)); });
1842
- i0.ɵɵelementEnd();
1843
- } if (rf & 2) {
1844
- i0.ɵɵproperty("text", true)("pTooltip", i0.ɵɵpipeBind1(1, 2, "shared.delete"));
1845
- } }
1846
- function TranslationKeyListPage_ng_template_23_Template(rf, ctx) { if (rf & 1) {
1847
- i0.ɵɵelementStart(0, "tr")(1, "td");
1848
- i0.ɵɵelement(2, "p-tag", 21);
1849
- i0.ɵɵelementEnd();
1850
- i0.ɵɵelementStart(3, "td")(4, "div", 22);
1851
- i0.ɵɵtext(5);
1852
- i0.ɵɵelementEnd();
1853
- i0.ɵɵconditionalCreate(6, TranslationKeyListPage_ng_template_23_Conditional_6_Template, 2, 1, "small", 23);
1854
- i0.ɵɵelementEnd();
1855
- i0.ɵɵelementStart(7, "td");
1856
- i0.ɵɵtext(8);
1857
- i0.ɵɵelementEnd();
1858
- i0.ɵɵelementStart(9, "td", 24)(10, "span", 25);
1859
- i0.ɵɵtext(11);
1860
- i0.ɵɵelementEnd()();
1861
- i0.ɵɵelementStart(12, "td")(13, "div", 26);
1862
- i0.ɵɵtemplate(14, TranslationKeyListPage_ng_template_23_p_button_14_Template, 2, 4, "p-button", 27)(15, TranslationKeyListPage_ng_template_23_p_button_15_Template, 2, 4, "p-button", 28);
1863
- i0.ɵɵelementEnd()()();
1864
- } if (rf & 2) {
1865
- const key_r4 = ctx.$implicit;
1866
- const ctx_r2 = i0.ɵɵnextContext();
1867
- i0.ɵɵadvance(2);
1868
- i0.ɵɵproperty("value", key_r4.module);
1869
- i0.ɵɵadvance(3);
1870
- i0.ɵɵtextInterpolate(key_r4.key);
1871
- i0.ɵɵadvance();
1872
- i0.ɵɵconditional(key_r4.description ? 6 : -1);
1873
- i0.ɵɵadvance(2);
1874
- i0.ɵɵtextInterpolate(key_r4.defaultMessage);
1875
- i0.ɵɵadvance(2);
1876
- i0.ɵɵclassProp("text-green-500", ctx_r2.getTranslationCount(key_r4.id) === ctx_r2.languages().length)("text-orange-500", ctx_r2.getTranslationCount(key_r4.id) < ctx_r2.languages().length && ctx_r2.getTranslationCount(key_r4.id) > 0)("text-muted-color", ctx_r2.getTranslationCount(key_r4.id) === 0);
1877
- i0.ɵɵadvance();
1878
- i0.ɵɵtextInterpolate2(" ", ctx_r2.getTranslationCount(key_r4.id), "/", ctx_r2.languages().length, " ");
1879
- i0.ɵɵadvance(3);
1880
- i0.ɵɵproperty("hasPermission", ctx_r2.TRANSLATION_KEY_PERMISSIONS.UPDATE);
1881
- i0.ɵɵadvance();
1882
- i0.ɵɵproperty("hasPermission", ctx_r2.TRANSLATION_KEY_PERMISSIONS.DELETE);
1883
- } }
1884
- function TranslationKeyListPage_ng_template_25_Template(rf, ctx) { if (rf & 1) {
1885
- i0.ɵɵelementStart(0, "tr")(1, "td", 31);
1886
- i0.ɵɵtext(2);
1887
- i0.ɵɵpipe(3, "translate");
1888
- i0.ɵɵelementEnd()();
1889
- } if (rf & 2) {
1890
- i0.ɵɵadvance(2);
1891
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "localization.key.empty"), " ");
1892
- } }
1893
- class TranslationKeyListPage {
1894
- TRANSLATION_KEY_PERMISSIONS = TRANSLATION_KEY_PERMISSIONS;
1895
- router = inject(Router);
1896
- languageService = inject(LanguageApiService);
1897
- translationKeyService = inject(TranslationKeyApiService);
1898
- translationService = inject(TranslationApiService);
1899
- confirmationService = inject(ConfirmationService);
1900
- messageService = inject(MessageService);
1901
- translateService = inject(TranslateService);
1902
- destroyRef = inject(DestroyRef);
1903
- isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1904
- languages = signal([], ...(ngDevMode ? [{ debugName: "languages" }] : []));
1905
- modules = signal([], ...(ngDevMode ? [{ debugName: "modules" }] : []));
1906
- translationKeys = signal([], ...(ngDevMode ? [{ debugName: "translationKeys" }] : []));
1907
- translationCounts = signal(new Map(), ...(ngDevMode ? [{ debugName: "translationCounts" }] : []));
1908
- selectedModule = signal(null, ...(ngDevMode ? [{ debugName: "selectedModule" }] : []));
1909
- searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
1910
- moduleOptions = computed(() => [
1911
- { label: this.translateService.instant('shared.all'), value: null },
1912
- ...this.modules().map((m) => ({ label: m, value: m })),
1913
- ], ...(ngDevMode ? [{ debugName: "moduleOptions" }] : []));
1914
- filteredKeys = computed(() => {
1915
- let keys = this.translationKeys();
1916
- const module = this.selectedModule();
1917
- const search = this.searchTerm().toLowerCase().trim();
1918
- if (module) {
1919
- keys = keys.filter((k) => k.module === module);
1920
- }
1921
- if (search) {
1922
- keys = keys.filter((k) => k.key.toLowerCase().includes(search) ||
1923
- k.defaultMessage.toLowerCase().includes(search) ||
1924
- k.module.toLowerCase().includes(search));
1925
- }
1926
- return keys;
1927
- }, ...(ngDevMode ? [{ debugName: "filteredKeys" }] : []));
1928
- ngOnInit() {
1929
- this.loadData();
1930
- }
1931
- loadData() {
1932
- this.isLoading.set(true);
1933
- forkJoin({
1934
- languages: this.languageService.getAll(),
1935
- modules: this.translationKeyService.getModules(),
1936
- keys: this.translationKeyService.getAll(),
1937
- })
1938
- .pipe(takeUntilDestroyed(this.destroyRef))
1939
- .subscribe({
1940
- next: ({ languages, modules, keys }) => {
1552
+ <!-- Language Name -->
1553
+ <div class="flex flex-col gap-2">
1554
+ <label for="name" class="font-medium">{{ 'localization.language.name' | translate }} *</label>
1555
+ <input
1556
+ pInputText
1557
+ id="name"
1558
+ [formField]="formTree.name"
1559
+ [placeholder]="'localization.placeholder.name' | translate" />
1560
+ </div>
1561
+
1562
+ <!-- Native Name -->
1563
+ <div class="flex flex-col gap-2">
1564
+ <label for="nativeName" class="font-medium">{{ 'localization.language.native.name' | translate }}</label>
1565
+ <input
1566
+ pInputText
1567
+ id="nativeName"
1568
+ [formField]="formTree.nativeName"
1569
+ [placeholder]="'localization.placeholder.native.name' | translate" />
1570
+ <small class="text-muted-color">{{ 'localization.language.native.name.hint' | translate }}</small>
1571
+ </div>
1572
+
1573
+ <!-- Text Direction -->
1574
+ <div class="flex flex-col gap-2">
1575
+ <label for="direction" class="font-medium">{{ 'localization.language.direction' | translate }} *</label>
1576
+ <p-select
1577
+ id="direction"
1578
+ [ngModel]="formModel().direction"
1579
+ (ngModelChange)="updateDirection($event)"
1580
+ [ngModelOptions]="{standalone: true}"
1581
+ [options]="directionOptions()"
1582
+ optionLabel="label"
1583
+ optionValue="value"
1584
+ class="w-full" />
1585
+ </div>
1586
+
1587
+ <!-- Display Order -->
1588
+ <div class="flex flex-col gap-2">
1589
+ <label for="serial" class="font-medium">{{ 'localization.language.display.order' | translate }}</label>
1590
+ <input
1591
+ pInputText
1592
+ id="serial"
1593
+ type="number"
1594
+ [formField]="formTree.serial"
1595
+ [placeholder]="'shared.display.order.placeholder' | translate" />
1596
+ </div>
1597
+
1598
+ <!-- Empty cell for alignment -->
1599
+ <div class="hidden md:block"></div>
1600
+
1601
+ <!-- Checkboxes -->
1602
+ <div class="flex items-center gap-6 md:col-span-2 pt-4">
1603
+ <label class="p-checkbox-native">
1604
+ <input type="checkbox" [formField]="formTree.isActive" />
1605
+ <span>{{ 'shared.active' | translate }}</span>
1606
+ </label>
1607
+ <label class="p-checkbox-native">
1608
+ <input type="checkbox" [formField]="formTree.isDefault" />
1609
+ <span>{{ 'localization.language.default' | translate }}</span>
1610
+ </label>
1611
+ </div>
1612
+
1613
+ <!-- Actions -->
1614
+ <div class="flex justify-end gap-4 md:col-span-2 pt-4">
1615
+ <p-button
1616
+ [label]="'shared.cancel' | translate"
1617
+ severity="secondary"
1618
+ [outlined]="true"
1619
+ (onClick)="onCancel()" />
1620
+ <p-button
1621
+ [label]="isEditMode() ? ('shared.update' | translate) : ('shared.create' | translate)"
1622
+ type="submit"
1623
+ [loading]="isSaving()"
1624
+ [disabled]="!isFormValid() || isSaving()" />
1625
+ </div>
1626
+ </form>
1627
+ </p-card>
1628
+
1629
+ <p-toast />
1630
+ `,
1631
+ }]
1632
+ }], ctorParameters: () => [] });
1633
+
1634
+ var languageForm_page = /*#__PURE__*/Object.freeze({
1635
+ __proto__: null,
1636
+ LanguageFormPage: LanguageFormPage
1637
+ });
1638
+
1639
+ class TranslationKeyListPage {
1640
+ TRANSLATION_KEY_PERMISSIONS = TRANSLATION_KEY_PERMISSIONS;
1641
+ router = inject(Router);
1642
+ languageService = inject(LanguageApiService);
1643
+ translationKeyService = inject(TranslationKeyApiService);
1644
+ translationService = inject(TranslationApiService);
1645
+ confirmationService = inject(ConfirmationService);
1646
+ messageService = inject(MessageService);
1647
+ translateService = inject(TranslateService);
1648
+ destroyRef = inject(DestroyRef);
1649
+ isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1650
+ languages = signal([], ...(ngDevMode ? [{ debugName: "languages" }] : []));
1651
+ modules = signal([], ...(ngDevMode ? [{ debugName: "modules" }] : []));
1652
+ translationKeys = signal([], ...(ngDevMode ? [{ debugName: "translationKeys" }] : []));
1653
+ translationCounts = signal(new Map(), ...(ngDevMode ? [{ debugName: "translationCounts" }] : []));
1654
+ selectedModule = signal(null, ...(ngDevMode ? [{ debugName: "selectedModule" }] : []));
1655
+ searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
1656
+ moduleOptions = computed(() => [
1657
+ { label: this.translateService.instant('shared.all'), value: null },
1658
+ ...this.modules().map((m) => ({ label: m, value: m })),
1659
+ ], ...(ngDevMode ? [{ debugName: "moduleOptions" }] : []));
1660
+ filteredKeys = computed(() => {
1661
+ let keys = this.translationKeys();
1662
+ const module = this.selectedModule();
1663
+ const search = this.searchTerm().toLowerCase().trim();
1664
+ if (module) {
1665
+ keys = keys.filter((k) => k.module === module);
1666
+ }
1667
+ if (search) {
1668
+ keys = keys.filter((k) => k.key.toLowerCase().includes(search) ||
1669
+ k.defaultMessage.toLowerCase().includes(search) ||
1670
+ k.module.toLowerCase().includes(search));
1671
+ }
1672
+ return keys;
1673
+ }, ...(ngDevMode ? [{ debugName: "filteredKeys" }] : []));
1674
+ ngOnInit() {
1675
+ this.loadData();
1676
+ }
1677
+ loadData() {
1678
+ this.isLoading.set(true);
1679
+ forkJoin({
1680
+ languages: this.languageService.getAll(),
1681
+ modules: this.translationKeyService.getModules(),
1682
+ keys: this.translationKeyService.getAll(),
1683
+ })
1684
+ .pipe(takeUntilDestroyed(this.destroyRef))
1685
+ .subscribe({
1686
+ next: ({ languages, modules, keys }) => {
1941
1687
  if (languages.success && languages.data) {
1942
1688
  this.languages.set(languages.data.filter((l) => l.isActive));
1943
1689
  }
@@ -2002,56 +1748,134 @@ class TranslationKeyListPage {
2002
1748
  },
2003
1749
  });
2004
1750
  }
2005
- static ɵfac = function TranslationKeyListPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationKeyListPage)(); };
2006
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TranslationKeyListPage, selectors: [["lib-translation-key-list-page"]], features: [i0.ɵɵProvidersFeature([ConfirmationService, MessageService])], decls: 29, vars: 27, consts: [["header", ""], ["body", ""], ["emptymessage", ""], [1, "card"], [1, "flex", "flex-col", "sm:flex-row", "justify-between", "items-start", "sm:items-center", "gap-3", "mb-4"], [1, "text-lg", "sm:text-xl", "font-semibold", "m-0"], [1, "text-sm", "text-muted-color", "mt-1"], [1, "flex", "gap-2"], ["icon", "pi pi-plus", 3, "label", "onClick", 4, "hasPermission"], [1, "flex", "flex-col", "md:flex-row", "gap-4", "mb-4"], [1, "flex-1"], ["optionLabel", "label", "optionValue", "value", 1, "w-full", 3, "ngModelChange", "options", "ngModel", "ngModelOptions", "placeholder", "showClear"], [1, "w-full"], [1, "pi", "pi-search"], ["pInputText", "", 1, "w-full", 3, "ngModelChange", "ngModel", "ngModelOptions", "placeholder"], ["styleClass", "p-datatable-sm", 3, "value", "loading", "paginator", "rows", "rowsPerPageOptions"], ["icon", "pi pi-plus", 3, "onClick", "label"], [2, "width", "15%"], [2, "width", "25%"], [2, "width", "35%"], [2, "width", "10%"], ["severity", "secondary", 3, "value"], [1, "font-medium"], [1, "text-muted-color"], [1, "text-center"], [1, "text-sm"], [1, "flex", "gap-1"], ["icon", "pi pi-pencil", "severity", "secondary", "size", "small", 3, "text", "pTooltip", "onClick", 4, "hasPermission"], ["icon", "pi pi-trash", "severity", "danger", "size", "small", 3, "text", "pTooltip", "onClick", 4, "hasPermission"], ["icon", "pi pi-pencil", "severity", "secondary", "size", "small", 3, "onClick", "text", "pTooltip"], ["icon", "pi pi-trash", "severity", "danger", "size", "small", 3, "onClick", "text", "pTooltip"], ["colspan", "5", 1, "text-center", "py-4", "text-muted-color"]], template: function TranslationKeyListPage_Template(rf, ctx) { if (rf & 1) {
2007
- const _r1 = i0.ɵɵgetCurrentView();
2008
- i0.ɵɵelementStart(0, "div", 3)(1, "div", 4)(2, "div")(3, "h3", 5);
2009
- i0.ɵɵtext(4);
2010
- i0.ɵɵpipe(5, "translate");
2011
- i0.ɵɵelementEnd();
2012
- i0.ɵɵelementStart(6, "p", 6);
2013
- i0.ɵɵtext(7);
2014
- i0.ɵɵpipe(8, "translate");
2015
- i0.ɵɵelementEnd()();
2016
- i0.ɵɵelementStart(9, "div", 7);
2017
- i0.ɵɵtemplate(10, TranslationKeyListPage_p_button_10_Template, 2, 3, "p-button", 8);
2018
- i0.ɵɵelementEnd()();
2019
- i0.ɵɵelementStart(11, "div", 9)(12, "div", 10)(13, "p-select", 11);
2020
- i0.ɵɵpipe(14, "translate");
2021
- i0.ɵɵlistener("ngModelChange", function TranslationKeyListPage_Template_p_select_ngModelChange_13_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onModuleChange($event)); });
2022
- i0.ɵɵelementEnd()();
2023
- i0.ɵɵelementStart(15, "div", 10)(16, "p-iconfield", 12);
2024
- i0.ɵɵelement(17, "p-inputicon", 13);
2025
- i0.ɵɵelementStart(18, "input", 14);
2026
- i0.ɵɵpipe(19, "translate");
2027
- i0.ɵɵlistener("ngModelChange", function TranslationKeyListPage_Template_input_ngModelChange_18_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.searchTerm.set($event)); });
2028
- i0.ɵɵelementEnd()()()();
2029
- i0.ɵɵelementStart(20, "p-table", 15);
2030
- i0.ɵɵtemplate(21, TranslationKeyListPage_ng_template_21_Template, 16, 15, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(23, TranslationKeyListPage_ng_template_23_Template, 16, 14, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(25, TranslationKeyListPage_ng_template_25_Template, 4, 3, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
2031
- i0.ɵɵelementEnd()();
2032
- i0.ɵɵelement(27, "p-confirmDialog")(28, "p-toast");
2033
- } if (rf & 2) {
2034
- i0.ɵɵadvance(4);
2035
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 16, "localization.key.title"));
2036
- i0.ɵɵadvance(3);
2037
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(8, 18, "localization.key.subtitle"));
2038
- i0.ɵɵadvance(3);
2039
- i0.ɵɵproperty("hasPermission", ctx.TRANSLATION_KEY_PERMISSIONS.CREATE);
2040
- i0.ɵɵadvance(3);
2041
- i0.ɵɵproperty("options", ctx.moduleOptions())("ngModel", ctx.selectedModule())("ngModelOptions", i0.ɵɵpureFunction0(24, _c0$2))("placeholder", i0.ɵɵpipeBind1(14, 20, "localization.key.filter.module"))("showClear", true);
2042
- i0.ɵɵadvance(5);
2043
- i0.ɵɵproperty("ngModel", ctx.searchTerm())("ngModelOptions", i0.ɵɵpureFunction0(25, _c0$2))("placeholder", i0.ɵɵpipeBind1(19, 22, "shared.search"));
2044
- i0.ɵɵadvance(2);
2045
- i0.ɵɵproperty("value", ctx.filteredKeys())("loading", ctx.isLoading())("paginator", true)("rows", 15)("rowsPerPageOptions", i0.ɵɵpureFunction0(26, _c1$1));
2046
- } }, dependencies: [AngularModule, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgModel, PrimeModule, i2.Button, i2$1.ConfirmDialog, i4$2.IconField, i5$1.InputIcon, i4$1.InputText, i5.Select, i8.Table, i4.Tag, i10.Toast, i6.Tooltip, FormsModule, HasPermissionDirective, TranslatePipe], encapsulation: 2 });
1751
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1752
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: TranslationKeyListPage, isStandalone: true, selector: "lib-translation-key-list-page", providers: [ConfirmationService, MessageService], ngImport: i0, template: `
1753
+ <div class="card">
1754
+ <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
1755
+ <div>
1756
+ <h3 class="text-lg sm:text-xl font-semibold m-0">{{ 'localization.key.title' | translate }}</h3>
1757
+ <p class="text-sm text-muted-color mt-1">{{ 'localization.key.subtitle' | translate }}</p>
1758
+ </div>
1759
+ <div class="flex gap-2">
1760
+ <p-button
1761
+ *hasPermission="TRANSLATION_KEY_PERMISSIONS.CREATE"
1762
+ [label]="'localization.key.create' | translate"
1763
+ icon="pi pi-plus"
1764
+ (onClick)="onCreate()"
1765
+ />
1766
+ </div>
1767
+ </div>
1768
+
1769
+ <!-- Filters -->
1770
+ <div class="flex flex-col md:flex-row gap-4 mb-4">
1771
+ <div class="flex-1">
1772
+ <p-select
1773
+ [options]="moduleOptions()"
1774
+ [ngModel]="selectedModule()"
1775
+ (ngModelChange)="onModuleChange($event)"
1776
+ [ngModelOptions]="{standalone: true}"
1777
+ optionLabel="label"
1778
+ optionValue="value"
1779
+ [placeholder]="'localization.key.filter.module' | translate"
1780
+ [showClear]="true"
1781
+ class="w-full"
1782
+ />
1783
+ </div>
1784
+ <div class="flex-1">
1785
+ <p-iconfield class="w-full">
1786
+ <p-inputicon class="pi pi-search" />
1787
+ <input
1788
+ pInputText
1789
+ [ngModel]="searchTerm()"
1790
+ (ngModelChange)="searchTerm.set($event)"
1791
+ [ngModelOptions]="{standalone: true}"
1792
+ [placeholder]="'shared.search' | translate"
1793
+ class="w-full"
1794
+ />
1795
+ </p-iconfield>
1796
+ </div>
1797
+ </div>
1798
+
1799
+ <!-- Table -->
1800
+ <p-table
1801
+ [value]="filteredKeys()"
1802
+ [loading]="isLoading()"
1803
+ [paginator]="true"
1804
+ [rows]="15"
1805
+ [rowsPerPageOptions]="[10, 15, 25, 50]"
1806
+ styleClass="p-datatable-sm"
1807
+ >
1808
+ <ng-template #header>
1809
+ <tr>
1810
+ <th style="width: 15%">{{ 'localization.key.module' | translate }}</th>
1811
+ <th style="width: 25%">{{ 'localization.key.name' | translate }}</th>
1812
+ <th style="width: 35%">{{ 'localization.key.default.message' | translate }}</th>
1813
+ <th style="width: 10%">{{ 'localization.key.translations' | translate }}</th>
1814
+ <th style="width: 15%">{{ 'shared.actions' | translate }}</th>
1815
+ </tr>
1816
+ </ng-template>
1817
+ <ng-template #body let-key>
1818
+ <tr>
1819
+ <td>
1820
+ <p-tag [value]="key.module" severity="secondary" />
1821
+ </td>
1822
+ <td>
1823
+ <div class="font-medium">{{ key.key }}</div>
1824
+ @if (key.description) {
1825
+ <small class="text-muted-color">{{ key.description }}</small>
1826
+ }
1827
+ </td>
1828
+ <td>{{ key.defaultMessage }}</td>
1829
+ <td class="text-center">
1830
+ <span class="text-sm" [class.text-green-500]="getTranslationCount(key.id) === languages().length" [class.text-orange-500]="getTranslationCount(key.id) < languages().length && getTranslationCount(key.id) > 0" [class.text-muted-color]="getTranslationCount(key.id) === 0">
1831
+ {{ getTranslationCount(key.id) }}/{{ languages().length }}
1832
+ </span>
1833
+ </td>
1834
+ <td>
1835
+ <div class="flex gap-1">
1836
+ <p-button
1837
+ *hasPermission="TRANSLATION_KEY_PERMISSIONS.UPDATE"
1838
+ icon="pi pi-pencil"
1839
+ [text]="true"
1840
+ severity="secondary"
1841
+ size="small"
1842
+ [pTooltip]="'shared.edit' | translate"
1843
+ (onClick)="onEdit(key)"
1844
+ />
1845
+ <p-button
1846
+ *hasPermission="TRANSLATION_KEY_PERMISSIONS.DELETE"
1847
+ icon="pi pi-trash"
1848
+ [text]="true"
1849
+ severity="danger"
1850
+ size="small"
1851
+ [pTooltip]="'shared.delete' | translate"
1852
+ (onClick)="onDelete(key)"
1853
+ />
1854
+ </div>
1855
+ </td>
1856
+ </tr>
1857
+ </ng-template>
1858
+ <ng-template #emptymessage>
1859
+ <tr>
1860
+ <td colspan="5" class="text-center py-4 text-muted-color">
1861
+ {{ 'localization.key.empty' | translate }}
1862
+ </td>
1863
+ </tr>
1864
+ </ng-template>
1865
+ </p-table>
1866
+ </div>
1867
+
1868
+ <p-confirmDialog />
1869
+ <p-toast />
1870
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: i2$1.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "component", type: i4$2.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i5$1.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "directive", type: i4$1.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: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i4.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
2047
1871
  }
2048
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationKeyListPage, [{
2049
- type: Component,
2050
- args: [{
2051
- selector: 'lib-translation-key-list-page',
2052
- imports: [AngularModule, PrimeModule, FormsModule, HasPermissionDirective, TranslatePipe],
2053
- providers: [ConfirmationService, MessageService],
2054
- template: `
1872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyListPage, decorators: [{
1873
+ type: Component,
1874
+ args: [{
1875
+ selector: 'lib-translation-key-list-page',
1876
+ imports: [AngularModule, PrimeModule, FormsModule, HasPermissionDirective, TranslatePipe],
1877
+ providers: [ConfirmationService, MessageService],
1878
+ template: `
2055
1879
  <div class="card">
2056
1880
  <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
2057
1881
  <div>
@@ -2170,84 +1994,14 @@ class TranslationKeyListPage {
2170
1994
  <p-confirmDialog />
2171
1995
  <p-toast />
2172
1996
  `,
2173
- }]
2174
- }], null, null); })();
2175
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TranslationKeyListPage, { className: "TranslationKeyListPage", filePath: "pages/translation-key-list/translation-key-list.page.ts", lineNumber: 146 }); })();
1997
+ }]
1998
+ }] });
2176
1999
 
2177
2000
  var translationKeyList_page = /*#__PURE__*/Object.freeze({
2178
2001
  __proto__: null,
2179
2002
  TranslationKeyListPage: TranslationKeyListPage
2180
2003
  });
2181
2004
 
2182
- const _c0$1 = () => ({ standalone: true });
2183
- const _forTrack0 = ($index, $item) => $item.id;
2184
- function TranslationKeyFormPage_ng_template_1_Template(rf, ctx) { if (rf & 1) {
2185
- i0.ɵɵelementStart(0, "div", 23)(1, "h2", 24);
2186
- i0.ɵɵtext(2);
2187
- i0.ɵɵpipe(3, "translate");
2188
- i0.ɵɵpipe(4, "translate");
2189
- i0.ɵɵelementEnd()();
2190
- } if (rf & 2) {
2191
- const ctx_r1 = i0.ɵɵnextContext();
2192
- i0.ɵɵadvance(2);
2193
- i0.ɵɵtextInterpolate1(" ", ctx_r1.isEditMode() ? i0.ɵɵpipeBind1(3, 1, "localization.key.edit") : i0.ɵɵpipeBind1(4, 3, "localization.key.create"), " ");
2194
- } }
2195
- function TranslationKeyFormPage_Conditional_46_Template(rf, ctx) { if (rf & 1) {
2196
- i0.ɵɵelementStart(0, "div", 18);
2197
- i0.ɵɵelement(1, "p-progressSpinner", 25);
2198
- i0.ɵɵelementEnd();
2199
- } }
2200
- function TranslationKeyFormPage_Conditional_47_Template(rf, ctx) { if (rf & 1) {
2201
- i0.ɵɵelementStart(0, "p", 19);
2202
- i0.ɵɵtext(1);
2203
- i0.ɵɵpipe(2, "translate");
2204
- i0.ɵɵelementEnd();
2205
- } if (rf & 2) {
2206
- i0.ɵɵadvance();
2207
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "localization.key.no.languages"), " ");
2208
- } }
2209
- function TranslationKeyFormPage_Conditional_48_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
2210
- i0.ɵɵelementStart(0, "span", 17);
2211
- i0.ɵɵtext(1);
2212
- i0.ɵɵelementEnd();
2213
- } if (rf & 2) {
2214
- const lang_r4 = i0.ɵɵnextContext().$implicit;
2215
- i0.ɵɵadvance();
2216
- i0.ɵɵtextInterpolate1("(", lang_r4.nativeName, ")");
2217
- } }
2218
- function TranslationKeyFormPage_Conditional_48_For_2_Template(rf, ctx) { if (rf & 1) {
2219
- const _r3 = i0.ɵɵgetCurrentView();
2220
- i0.ɵɵelementStart(0, "div", 5)(1, "div", 26)(2, "label", 27);
2221
- i0.ɵɵtext(3);
2222
- i0.ɵɵconditionalCreate(4, TranslationKeyFormPage_Conditional_48_For_2_Conditional_4_Template, 2, 1, "span", 17);
2223
- i0.ɵɵelementEnd();
2224
- i0.ɵɵelement(5, "p-tag", 28);
2225
- i0.ɵɵelementEnd();
2226
- i0.ɵɵelementStart(6, "textarea", 29);
2227
- i0.ɵɵpipe(7, "translate");
2228
- i0.ɵɵlistener("ngModelChange", function TranslationKeyFormPage_Conditional_48_For_2_Template_textarea_ngModelChange_6_listener($event) { const lang_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.setTranslationValue(lang_r4.id, $event)); });
2229
- i0.ɵɵelementEnd()();
2230
- } if (rf & 2) {
2231
- const lang_r4 = ctx.$implicit;
2232
- const ctx_r1 = i0.ɵɵnextContext(2);
2233
- i0.ɵɵadvance(3);
2234
- i0.ɵɵtextInterpolate1(" ", lang_r4.name, " ");
2235
- i0.ɵɵadvance();
2236
- i0.ɵɵconditional(lang_r4.nativeName && lang_r4.nativeName !== lang_r4.name ? 4 : -1);
2237
- i0.ɵɵadvance();
2238
- i0.ɵɵproperty("value", lang_r4.code);
2239
- i0.ɵɵadvance();
2240
- i0.ɵɵproperty("ngModel", ctx_r1.getTranslationValue(lang_r4.id))("ngModelOptions", i0.ɵɵpureFunction0(9, _c0$1))("rows", 2)("placeholder", ctx_r1.formModel().defaultMessage || i0.ɵɵpipeBind1(7, 7, "localization.key.enter.translation"));
2241
- } }
2242
- function TranslationKeyFormPage_Conditional_48_Template(rf, ctx) { if (rf & 1) {
2243
- i0.ɵɵelementStart(0, "div", 4);
2244
- i0.ɵɵrepeaterCreate(1, TranslationKeyFormPage_Conditional_48_For_2_Template, 8, 10, "div", 5, _forTrack0);
2245
- i0.ɵɵelementEnd();
2246
- } if (rf & 2) {
2247
- const ctx_r1 = i0.ɵɵnextContext();
2248
- i0.ɵɵadvance();
2249
- i0.ɵɵrepeater(ctx_r1.languages());
2250
- } }
2251
2005
  class TranslationKeyFormPage {
2252
2006
  router = inject(Router);
2253
2007
  route = inject(ActivatedRoute);
@@ -2483,121 +2237,8 @@ class TranslationKeyFormPage {
2483
2237
  onCancel() {
2484
2238
  this.router.navigate(['/localization/keys']);
2485
2239
  }
2486
- static ɵfac = function TranslationKeyFormPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationKeyFormPage)(); };
2487
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TranslationKeyFormPage, selectors: [["lib-translation-key-form-page"]], features: [i0.ɵɵProvidersFeature([MessageService])], decls: 56, vars: 65, consts: [["header", ""], [1, "flex", "flex-col", "gap-6", 3, "ngSubmit"], [1, "p-4", "surface-ground", "rounded-lg"], [1, "font-semibold", "mt-0", "mb-4"], [1, "grid", "grid-cols-1", "md:grid-cols-2", "gap-4"], [1, "flex", "flex-col", "gap-2"], ["for", "key", 1, "font-medium"], ["pInputText", "", "id", "key", 3, "formField", "placeholder"], ["for", "module", 1, "font-medium"], ["id", "module", "optionLabel", "label", "optionValue", "value", 1, "w-full", 3, "ngModelChange", "ngModel", "ngModelOptions", "options", "editable", "placeholder"], [1, "flex", "flex-col", "gap-2", "md:col-span-2"], ["for", "defaultMessage", 1, "font-medium"], ["pInputTextarea", "", "id", "defaultMessage", 3, "formField", "rows", "placeholder"], ["for", "description", 1, "font-medium"], ["pInputText", "", "id", "description", 3, "formField", "placeholder"], ["for", "variables", 1, "font-medium"], ["pInputText", "", "id", "variables", 3, "formField", "placeholder"], [1, "text-muted-color"], [1, "flex", "justify-center", "py-4"], [1, "text-muted-color", "text-center", "py-4"], [1, "flex", "justify-end", "gap-4", "pt-4"], ["severity", "secondary", 3, "onClick", "label", "outlined"], ["type", "submit", 3, "label", "loading", "disabled"], [1, "flex", "justify-between", "items-center", "p-4"], [1, "text-xl", "font-semibold", "m-0"], ["strokeWidth", "4"], [1, "flex", "justify-between", "items-center"], [1, "font-medium"], ["severity", "secondary", 1, "uppercase", 3, "value"], ["pInputTextarea", "", 3, "ngModelChange", "ngModel", "ngModelOptions", "rows", "placeholder"]], template: function TranslationKeyFormPage_Template(rf, ctx) { if (rf & 1) {
2488
- const _r1 = i0.ɵɵgetCurrentView();
2489
- i0.ɵɵelementStart(0, "p-card");
2490
- i0.ɵɵtemplate(1, TranslationKeyFormPage_ng_template_1_Template, 5, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
2491
- i0.ɵɵelementStart(3, "form", 1);
2492
- i0.ɵɵlistener("ngSubmit", function TranslationKeyFormPage_Template_form_ngSubmit_3_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onSubmit()); });
2493
- i0.ɵɵelementStart(4, "div", 2)(5, "h4", 3);
2494
- i0.ɵɵtext(6);
2495
- i0.ɵɵpipe(7, "translate");
2496
- i0.ɵɵelementEnd();
2497
- i0.ɵɵelementStart(8, "div", 4)(9, "div", 5)(10, "label", 6);
2498
- i0.ɵɵtext(11);
2499
- i0.ɵɵpipe(12, "translate");
2500
- i0.ɵɵelementEnd();
2501
- i0.ɵɵelement(13, "input", 7);
2502
- i0.ɵɵpipe(14, "translate");
2503
- i0.ɵɵcontrolCreate();
2504
- i0.ɵɵelementEnd();
2505
- i0.ɵɵelementStart(15, "div", 5)(16, "label", 8);
2506
- i0.ɵɵtext(17);
2507
- i0.ɵɵpipe(18, "translate");
2508
- i0.ɵɵelementEnd();
2509
- i0.ɵɵelementStart(19, "p-select", 9);
2510
- i0.ɵɵpipe(20, "translate");
2511
- i0.ɵɵlistener("ngModelChange", function TranslationKeyFormPage_Template_p_select_ngModelChange_19_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.updateModule($event)); });
2512
- i0.ɵɵelementEnd()();
2513
- i0.ɵɵelementStart(21, "div", 10)(22, "label", 11);
2514
- i0.ɵɵtext(23);
2515
- i0.ɵɵpipe(24, "translate");
2516
- i0.ɵɵelementEnd();
2517
- i0.ɵɵelement(25, "textarea", 12);
2518
- i0.ɵɵpipe(26, "translate");
2519
- i0.ɵɵcontrolCreate();
2520
- i0.ɵɵelementEnd();
2521
- i0.ɵɵelementStart(27, "div", 10)(28, "label", 13);
2522
- i0.ɵɵtext(29);
2523
- i0.ɵɵpipe(30, "translate");
2524
- i0.ɵɵelementEnd();
2525
- i0.ɵɵelement(31, "input", 14);
2526
- i0.ɵɵpipe(32, "translate");
2527
- i0.ɵɵcontrolCreate();
2528
- i0.ɵɵelementEnd();
2529
- i0.ɵɵelementStart(33, "div", 10)(34, "label", 15);
2530
- i0.ɵɵtext(35);
2531
- i0.ɵɵpipe(36, "translate");
2532
- i0.ɵɵelementEnd();
2533
- i0.ɵɵelement(37, "input", 16);
2534
- i0.ɵɵpipe(38, "translate");
2535
- i0.ɵɵcontrolCreate();
2536
- i0.ɵɵelementStart(39, "small", 17);
2537
- i0.ɵɵtext(40);
2538
- i0.ɵɵpipe(41, "translate");
2539
- i0.ɵɵelementEnd()()()();
2540
- i0.ɵɵelementStart(42, "div", 2)(43, "h4", 3);
2541
- i0.ɵɵtext(44);
2542
- i0.ɵɵpipe(45, "translate");
2543
- i0.ɵɵelementEnd();
2544
- i0.ɵɵconditionalCreate(46, TranslationKeyFormPage_Conditional_46_Template, 2, 0, "div", 18)(47, TranslationKeyFormPage_Conditional_47_Template, 3, 3, "p", 19)(48, TranslationKeyFormPage_Conditional_48_Template, 3, 0, "div", 4);
2545
- i0.ɵɵelementEnd();
2546
- i0.ɵɵelementStart(49, "div", 20)(50, "p-button", 21);
2547
- i0.ɵɵpipe(51, "translate");
2548
- i0.ɵɵlistener("onClick", function TranslationKeyFormPage_Template_p_button_onClick_50_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onCancel()); });
2549
- i0.ɵɵelementEnd();
2550
- i0.ɵɵelement(52, "p-button", 22);
2551
- i0.ɵɵpipe(53, "translate");
2552
- i0.ɵɵpipe(54, "translate");
2553
- i0.ɵɵelementEnd()()();
2554
- i0.ɵɵelement(55, "p-toast");
2555
- } if (rf & 2) {
2556
- i0.ɵɵadvance(6);
2557
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 32, "localization.key.about"));
2558
- i0.ɵɵadvance(5);
2559
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(12, 34, "localization.key.name"), " *");
2560
- i0.ɵɵadvance(2);
2561
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(14, 36, "localization.placeholder.key.name"));
2562
- i0.ɵɵcontrol(ctx.formTree.key, "formField");
2563
- i0.ɵɵadvance(4);
2564
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(18, 38, "localization.key.module"), " *");
2565
- i0.ɵɵadvance(2);
2566
- i0.ɵɵproperty("ngModel", ctx.formModel().module)("ngModelOptions", i0.ɵɵpureFunction0(64, _c0$1))("options", ctx.moduleOptions())("editable", true)("placeholder", i0.ɵɵpipeBind1(20, 40, "localization.key.select.module"));
2567
- i0.ɵɵadvance(4);
2568
- i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(24, 42, "localization.key.default.message"), " *");
2569
- i0.ɵɵadvance(2);
2570
- i0.ɵɵproperty("rows", 2)("placeholder", i0.ɵɵpipeBind1(26, 44, "localization.placeholder.default.message"));
2571
- i0.ɵɵcontrol(ctx.formTree.defaultMessage, "formField");
2572
- i0.ɵɵadvance(4);
2573
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 46, "localization.key.description"));
2574
- i0.ɵɵadvance(2);
2575
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(32, 48, "localization.placeholder.key.description"));
2576
- i0.ɵɵcontrol(ctx.formTree.description, "formField");
2577
- i0.ɵɵadvance(4);
2578
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 50, "localization.key.variables"));
2579
- i0.ɵɵadvance(2);
2580
- i0.ɵɵproperty("placeholder", i0.ɵɵpipeBind1(38, 52, "localization.key.variables.placeholder"));
2581
- i0.ɵɵcontrol(ctx.formTree.variables, "formField");
2582
- i0.ɵɵadvance(3);
2583
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(41, 54, "localization.key.variables.hint"));
2584
- i0.ɵɵadvance(4);
2585
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 56, "localization.key.translations.section"));
2586
- i0.ɵɵadvance(2);
2587
- i0.ɵɵconditional(ctx.isLoadingLanguages() ? 46 : ctx.languages().length === 0 ? 47 : 48);
2588
- i0.ɵɵadvance(4);
2589
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(51, 58, "shared.cancel"))("outlined", true);
2590
- i0.ɵɵadvance(2);
2591
- i0.ɵɵproperty("label", ctx.isEditMode() ? i0.ɵɵpipeBind1(53, 60, "shared.update") : i0.ɵɵpipeBind1(54, 62, "shared.create"))("loading", ctx.isSaving())("disabled", !ctx.isFormValid() || ctx.isSaving());
2592
- } }, dependencies: [AngularModule, i1$1.ɵNgNoValidate, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgControlStatusGroup, i1$1.NgModel, i1$1.NgForm, PrimeModule, i2.Button, i3.Card, i4$1.InputText, i5.Select, i4.Tag, i7.Textarea, i10.Toast, i9.ProgressSpinner, FormsModule, FormField, TranslatePipe], encapsulation: 2 });
2593
- }
2594
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationKeyFormPage, [{
2595
- type: Component,
2596
- args: [{
2597
- selector: 'lib-translation-key-form-page',
2598
- imports: [AngularModule, PrimeModule, FormsModule, FormField, TranslatePipe],
2599
- providers: [MessageService],
2600
- template: `
2240
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
2241
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: TranslationKeyFormPage, isStandalone: true, selector: "lib-translation-key-form-page", providers: [MessageService], ngImport: i0, template: `
2601
2242
  <p-card>
2602
2243
  <ng-template #header>
2603
2244
  <div class="flex justify-between items-center p-4">
@@ -2726,162 +2367,152 @@ class TranslationKeyFormPage {
2726
2367
  </p-card>
2727
2368
 
2728
2369
  <p-toast />
2729
- `,
2730
- }]
2731
- }], () => [], null); })();
2732
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TranslationKeyFormPage, { className: "TranslationKeyFormPage", filePath: "pages/translation-key-form/translation-key-form.page.ts", lineNumber: 173 }); })();
2733
-
2734
- var translationKeyForm_page = /*#__PURE__*/Object.freeze({
2735
- __proto__: null,
2736
- TranslationKeyFormPage: TranslationKeyFormPage
2370
+ `, 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$1.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.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: i10.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" }] });
2371
+ }
2372
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationKeyFormPage, decorators: [{
2373
+ type: Component,
2374
+ args: [{
2375
+ selector: 'lib-translation-key-form-page',
2376
+ imports: [AngularModule, PrimeModule, FormsModule, FormField, TranslatePipe],
2377
+ providers: [MessageService],
2378
+ template: `
2379
+ <p-card>
2380
+ <ng-template #header>
2381
+ <div class="flex justify-between items-center p-4">
2382
+ <h2 class="text-xl font-semibold m-0">
2383
+ {{ isEditMode() ? ('localization.key.edit' | translate) : ('localization.key.create' | translate) }}
2384
+ </h2>
2385
+ </div>
2386
+ </ng-template>
2387
+
2388
+ <form (ngSubmit)="onSubmit()" class="flex flex-col gap-6">
2389
+ <!-- Key Info Section -->
2390
+ <div class="p-4 surface-ground rounded-lg">
2391
+ <h4 class="font-semibold mt-0 mb-4">{{ 'localization.key.about' | translate }}</h4>
2392
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
2393
+ <!-- Key Name -->
2394
+ <div class="flex flex-col gap-2">
2395
+ <label for="key" class="font-medium">{{ 'localization.key.name' | translate }} *</label>
2396
+ <input
2397
+ pInputText
2398
+ id="key"
2399
+ [formField]="formTree.key"
2400
+ [placeholder]="'localization.placeholder.key.name' | translate" />
2401
+ </div>
2402
+
2403
+ <!-- Module -->
2404
+ <div class="flex flex-col gap-2">
2405
+ <label for="module" class="font-medium">{{ 'localization.key.module' | translate }} *</label>
2406
+ <p-select
2407
+ id="module"
2408
+ [ngModel]="formModel().module"
2409
+ (ngModelChange)="updateModule($event)"
2410
+ [ngModelOptions]="{standalone: true}"
2411
+ [options]="moduleOptions()"
2412
+ optionLabel="label"
2413
+ optionValue="value"
2414
+ [editable]="true"
2415
+ [placeholder]="'localization.key.select.module' | translate"
2416
+ class="w-full" />
2417
+ </div>
2418
+
2419
+ <!-- Default Message -->
2420
+ <div class="flex flex-col gap-2 md:col-span-2">
2421
+ <label for="defaultMessage" class="font-medium">{{ 'localization.key.default.message' | translate }} *</label>
2422
+ <textarea
2423
+ pInputTextarea
2424
+ id="defaultMessage"
2425
+ [formField]="formTree.defaultMessage"
2426
+ [rows]="2"
2427
+ [placeholder]="'localization.placeholder.default.message' | translate"></textarea>
2428
+ </div>
2429
+
2430
+ <!-- Description -->
2431
+ <div class="flex flex-col gap-2 md:col-span-2">
2432
+ <label for="description" class="font-medium">{{ 'localization.key.description' | translate }}</label>
2433
+ <input
2434
+ pInputText
2435
+ id="description"
2436
+ [formField]="formTree.description"
2437
+ [placeholder]="'localization.placeholder.key.description' | translate" />
2438
+ </div>
2439
+
2440
+ <!-- Variables -->
2441
+ <div class="flex flex-col gap-2 md:col-span-2">
2442
+ <label for="variables" class="font-medium">{{ 'localization.key.variables' | translate }}</label>
2443
+ <input
2444
+ pInputText
2445
+ id="variables"
2446
+ [formField]="formTree.variables"
2447
+ [placeholder]="'localization.key.variables.placeholder' | translate" />
2448
+ <small class="text-muted-color">{{ 'localization.key.variables.hint' | translate }}</small>
2449
+ </div>
2450
+ </div>
2451
+ </div>
2452
+
2453
+ <!-- Translations Section -->
2454
+ <div class="p-4 surface-ground rounded-lg">
2455
+ <h4 class="font-semibold mt-0 mb-4">{{ 'localization.key.translations.section' | translate }}</h4>
2456
+ @if (isLoadingLanguages()) {
2457
+ <div class="flex justify-center py-4">
2458
+ <p-progressSpinner strokeWidth="4" />
2459
+ </div>
2460
+ } @else if (languages().length === 0) {
2461
+ <p class="text-muted-color text-center py-4">
2462
+ {{ 'localization.key.no.languages' | translate }}
2463
+ </p>
2464
+ } @else {
2465
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
2466
+ @for (lang of languages(); track lang.id) {
2467
+ <div class="flex flex-col gap-2">
2468
+ <div class="flex justify-between items-center">
2469
+ <label class="font-medium">
2470
+ {{ lang.name }}
2471
+ @if (lang.nativeName && lang.nativeName !== lang.name) {
2472
+ <span class="text-muted-color">({{ lang.nativeName }})</span>
2473
+ }
2474
+ </label>
2475
+ <p-tag [value]="lang.code" severity="secondary" class="uppercase" />
2476
+ </div>
2477
+ <textarea
2478
+ pInputTextarea
2479
+ [ngModel]="getTranslationValue(lang.id)"
2480
+ (ngModelChange)="setTranslationValue(lang.id, $event)"
2481
+ [ngModelOptions]="{standalone: true}"
2482
+ [rows]="2"
2483
+ [placeholder]="formModel().defaultMessage || ('localization.key.enter.translation' | translate)"></textarea>
2484
+ </div>
2485
+ }
2486
+ </div>
2487
+ }
2488
+ </div>
2489
+
2490
+ <!-- Actions -->
2491
+ <div class="flex justify-end gap-4 pt-4">
2492
+ <p-button
2493
+ [label]="'shared.cancel' | translate"
2494
+ severity="secondary"
2495
+ [outlined]="true"
2496
+ (onClick)="onCancel()" />
2497
+ <p-button
2498
+ [label]="isEditMode() ? ('shared.update' | translate) : ('shared.create' | translate)"
2499
+ type="submit"
2500
+ [loading]="isSaving()"
2501
+ [disabled]="!isFormValid() || isSaving()" />
2502
+ </div>
2503
+ </form>
2504
+ </p-card>
2505
+
2506
+ <p-toast />
2507
+ `,
2508
+ }]
2509
+ }], ctorParameters: () => [] });
2510
+
2511
+ var translationKeyForm_page = /*#__PURE__*/Object.freeze({
2512
+ __proto__: null,
2513
+ TranslationKeyFormPage: TranslationKeyFormPage
2737
2514
  });
2738
2515
 
2739
- const _c0 = () => ({ standalone: true });
2740
- const _c1 = () => [10, 20, 50, 100];
2741
- const _c2 = a0 => ({ count: a0 });
2742
- function TranslationListPage_Conditional_29_Template(rf, ctx) { if (rf & 1) {
2743
- i0.ɵɵelementStart(0, "div", 15);
2744
- i0.ɵɵelement(1, "p-progressSpinner", 21);
2745
- i0.ɵɵelementEnd();
2746
- } }
2747
- function TranslationListPage_Conditional_30_Template(rf, ctx) { if (rf & 1) {
2748
- i0.ɵɵelementStart(0, "div", 16)(1, "p");
2749
- i0.ɵɵtext(2);
2750
- i0.ɵɵpipe(3, "translate");
2751
- i0.ɵɵelementEnd()();
2752
- } if (rf & 2) {
2753
- i0.ɵɵadvance(2);
2754
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "localization.translation.select.language.hint"));
2755
- } }
2756
- function TranslationListPage_Conditional_31_Template(rf, ctx) { if (rf & 1) {
2757
- i0.ɵɵelementStart(0, "div", 16)(1, "p");
2758
- i0.ɵɵtext(2);
2759
- i0.ɵɵpipe(3, "translate");
2760
- i0.ɵɵelementEnd()();
2761
- } if (rf & 2) {
2762
- i0.ɵɵadvance(2);
2763
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "localization.translation.no.keys"));
2764
- } }
2765
- function TranslationListPage_Conditional_32_ng_template_1_Template(rf, ctx) { if (rf & 1) {
2766
- i0.ɵɵelementStart(0, "tr")(1, "th", 22);
2767
- i0.ɵɵtext(2);
2768
- i0.ɵɵpipe(3, "translate");
2769
- i0.ɵɵelementEnd();
2770
- i0.ɵɵelementStart(4, "th", 23);
2771
- i0.ɵɵtext(5);
2772
- i0.ɵɵpipe(6, "translate");
2773
- i0.ɵɵelementEnd();
2774
- i0.ɵɵelementStart(7, "th", 24);
2775
- i0.ɵɵtext(8);
2776
- i0.ɵɵpipe(9, "translate");
2777
- i0.ɵɵelementEnd();
2778
- i0.ɵɵelementStart(10, "th", 25);
2779
- i0.ɵɵtext(11);
2780
- i0.ɵɵpipe(12, "translate");
2781
- i0.ɵɵelementEnd()();
2782
- } if (rf & 2) {
2783
- i0.ɵɵadvance(2);
2784
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 4, "localization.translation.key"));
2785
- i0.ɵɵadvance(3);
2786
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 6, "localization.translation.default.message"));
2787
- i0.ɵɵadvance(3);
2788
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 8, "localization.translation.value"));
2789
- i0.ɵɵadvance(3);
2790
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 10, "localization.translation.verified"));
2791
- } }
2792
- function TranslationListPage_Conditional_32_ng_template_3_Conditional_4_Template(rf, ctx) { if (rf & 1) {
2793
- i0.ɵɵelementStart(0, "small", 19);
2794
- i0.ɵɵtext(1);
2795
- i0.ɵɵelementEnd();
2796
- } if (rf & 2) {
2797
- const row_r2 = i0.ɵɵnextContext().$implicit;
2798
- i0.ɵɵadvance();
2799
- i0.ɵɵtextInterpolate(row_r2.translationKey.description);
2800
- } }
2801
- function TranslationListPage_Conditional_32_ng_template_3_Conditional_5_For_2_Template(rf, ctx) { if (rf & 1) {
2802
- i0.ɵɵelementStart(0, "span", 32);
2803
- i0.ɵɵtext(1);
2804
- i0.ɵɵelementEnd();
2805
- } if (rf & 2) {
2806
- const v_r3 = ctx.$implicit;
2807
- const ctx_r3 = i0.ɵɵnextContext(4);
2808
- i0.ɵɵadvance();
2809
- i0.ɵɵtextInterpolate(ctx_r3.formatVariable(v_r3));
2810
- } }
2811
- function TranslationListPage_Conditional_32_ng_template_3_Conditional_5_Template(rf, ctx) { if (rf & 1) {
2812
- i0.ɵɵelementStart(0, "div", 27);
2813
- i0.ɵɵrepeaterCreate(1, TranslationListPage_Conditional_32_ng_template_3_Conditional_5_For_2_Template, 2, 1, "span", 32, i0.ɵɵrepeaterTrackByIdentity);
2814
- i0.ɵɵelementEnd();
2815
- } if (rf & 2) {
2816
- const row_r2 = i0.ɵɵnextContext().$implicit;
2817
- i0.ɵɵadvance();
2818
- i0.ɵɵrepeater(row_r2.translationKey.variables);
2819
- } }
2820
- function TranslationListPage_Conditional_32_ng_template_3_Template(rf, ctx) { if (rf & 1) {
2821
- const _r1 = i0.ɵɵgetCurrentView();
2822
- i0.ɵɵelementStart(0, "tr")(1, "td")(2, "div", 26);
2823
- i0.ɵɵtext(3);
2824
- i0.ɵɵelementEnd();
2825
- i0.ɵɵconditionalCreate(4, TranslationListPage_Conditional_32_ng_template_3_Conditional_4_Template, 2, 1, "small", 19);
2826
- i0.ɵɵconditionalCreate(5, TranslationListPage_Conditional_32_ng_template_3_Conditional_5_Template, 3, 0, "div", 27);
2827
- i0.ɵɵelementEnd();
2828
- i0.ɵɵelementStart(6, "td")(7, "span", 28);
2829
- i0.ɵɵtext(8);
2830
- i0.ɵɵelementEnd()();
2831
- i0.ɵɵelementStart(9, "td")(10, "textarea", 29);
2832
- i0.ɵɵtwoWayListener("ngModelChange", function TranslationListPage_Conditional_32_ng_template_3_Template_textarea_ngModelChange_10_listener($event) { const row_r2 = i0.ɵɵrestoreView(_r1).$implicit; i0.ɵɵtwoWayBindingSet(row_r2.editValue, $event) || (row_r2.editValue = $event); return i0.ɵɵresetView($event); });
2833
- i0.ɵɵlistener("input", function TranslationListPage_Conditional_32_ng_template_3_Template_textarea_input_10_listener() { const row_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.onValueChange(row_r2)); });
2834
- i0.ɵɵelementEnd()();
2835
- i0.ɵɵelementStart(11, "td", 30)(12, "p-checkbox", 31);
2836
- i0.ɵɵtwoWayListener("ngModelChange", function TranslationListPage_Conditional_32_ng_template_3_Template_p_checkbox_ngModelChange_12_listener($event) { const row_r2 = i0.ɵɵrestoreView(_r1).$implicit; i0.ɵɵtwoWayBindingSet(row_r2.isVerified, $event) || (row_r2.isVerified = $event); return i0.ɵɵresetView($event); });
2837
- i0.ɵɵlistener("onChange", function TranslationListPage_Conditional_32_ng_template_3_Template_p_checkbox_onChange_12_listener() { const row_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.onVerifiedChange(row_r2)); });
2838
- i0.ɵɵelementEnd()()();
2839
- } if (rf & 2) {
2840
- const row_r2 = ctx.$implicit;
2841
- i0.ɵɵclassProp("bg-yellow-50", row_r2.isDirty);
2842
- i0.ɵɵadvance(3);
2843
- i0.ɵɵtextInterpolate(row_r2.translationKey.key);
2844
- i0.ɵɵadvance();
2845
- i0.ɵɵconditional(row_r2.translationKey.description ? 4 : -1);
2846
- i0.ɵɵadvance();
2847
- i0.ɵɵconditional((row_r2.translationKey.variables == null ? null : row_r2.translationKey.variables.length) ? 5 : -1);
2848
- i0.ɵɵadvance(3);
2849
- i0.ɵɵtextInterpolate(row_r2.translationKey.defaultMessage);
2850
- i0.ɵɵadvance(2);
2851
- i0.ɵɵtwoWayProperty("ngModel", row_r2.editValue);
2852
- i0.ɵɵproperty("ngModelOptions", i0.ɵɵpureFunction0(13, _c0))("rows", 2)("placeholder", row_r2.translationKey.defaultMessage);
2853
- i0.ɵɵadvance(2);
2854
- i0.ɵɵtwoWayProperty("ngModel", row_r2.isVerified);
2855
- i0.ɵɵproperty("ngModelOptions", i0.ɵɵpureFunction0(14, _c0))("binary", true);
2856
- } }
2857
- function TranslationListPage_Conditional_32_ng_template_5_Template(rf, ctx) { if (rf & 1) {
2858
- i0.ɵɵelementStart(0, "tr")(1, "td", 33);
2859
- i0.ɵɵtext(2);
2860
- i0.ɵɵpipe(3, "translate");
2861
- i0.ɵɵelementEnd()();
2862
- } if (rf & 2) {
2863
- i0.ɵɵadvance(2);
2864
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "shared.no.results"), " ");
2865
- } }
2866
- function TranslationListPage_Conditional_32_Template(rf, ctx) { if (rf & 1) {
2867
- i0.ɵɵelementStart(0, "p-table", 17);
2868
- i0.ɵɵtemplate(1, TranslationListPage_Conditional_32_ng_template_1_Template, 13, 12, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(3, TranslationListPage_Conditional_32_ng_template_3_Template, 13, 15, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(5, TranslationListPage_Conditional_32_ng_template_5_Template, 4, 3, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
2869
- i0.ɵɵelementEnd();
2870
- } if (rf & 2) {
2871
- const ctx_r3 = i0.ɵɵnextContext();
2872
- i0.ɵɵproperty("value", ctx_r3.filteredRows())("paginator", true)("rows", 20)("rowsPerPageOptions", i0.ɵɵpureFunction0(6, _c1))("showCurrentPageReport", true)("currentPageReportTemplate", ctx_r3.paginationTemplate());
2873
- } }
2874
- function TranslationListPage_Conditional_35_Template(rf, ctx) { if (rf & 1) {
2875
- i0.ɵɵelementStart(0, "span", 20);
2876
- i0.ɵɵelement(1, "i", 34);
2877
- i0.ɵɵtext(2);
2878
- i0.ɵɵpipe(3, "translate");
2879
- i0.ɵɵelementEnd();
2880
- } if (rf & 2) {
2881
- const ctx_r3 = i0.ɵɵnextContext();
2882
- i0.ɵɵadvance(2);
2883
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(3, 1, "localization.translation.unsaved.changes", i0.ɵɵpureFunction1(4, _c2, ctx_r3.changedCount())), " ");
2884
- } }
2885
2516
  class TranslationListPage {
2886
2517
  languageService = inject(LanguageApiService);
2887
2518
  translationKeyService = inject(TranslationKeyApiService);
@@ -3050,83 +2681,173 @@ class TranslationListPage {
3050
2681
  },
3051
2682
  });
3052
2683
  }
3053
- static ɵfac = function TranslationListPage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TranslationListPage)(); };
3054
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TranslationListPage, selectors: [["lib-translation-list-page"]], features: [i0.ɵɵProvidersFeature([MessageService])], decls: 39, vars: 44, consts: [["header", ""], ["body", ""], ["emptymessage", ""], [1, "card"], [1, "flex", "flex-col", "sm:flex-row", "justify-between", "items-start", "sm:items-center", "gap-4", "mb-4"], [1, "text-xl", "font-semibold", "m-0"], [1, "flex", "gap-2"], ["icon", "pi pi-save", 3, "onClick", "label", "disabled", "loading"], [1, "flex", "flex-col", "md:flex-row", "gap-4", "mb-4"], [1, "flex-1"], [1, "block", "font-medium", "mb-2"], ["optionLabel", "label", "optionValue", "value", 1, "w-full", 3, "ngModelChange", "options", "ngModel", "ngModelOptions", "placeholder"], [1, "w-full"], [1, "pi", "pi-search"], ["pInputText", "", 1, "w-full", 3, "ngModelChange", "ngModel", "ngModelOptions", "placeholder"], [1, "flex", "justify-center", "py-8"], [1, "text-center", "py-8", "text-muted-color"], ["styleClass", "p-datatable-sm", 3, "value", "paginator", "rows", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate"], [1, "flex", "justify-between", "items-center", "mt-4"], [1, "text-muted-color"], [1, "text-orange-500"], ["strokeWidth", "4"], [2, "width", "30%"], [2, "width", "25%"], [2, "width", "35%"], [2, "width", "10%"], [1, "font-medium", "text-sm"], [1, "mt-1"], [1, "text-sm"], ["pInputTextarea", "", 1, "w-full", 3, "ngModelChange", "input", "ngModel", "ngModelOptions", "rows", "placeholder"], [1, "text-center"], [3, "ngModelChange", "onChange", "ngModel", "ngModelOptions", "binary"], [1, "text-xs", "bg-surface-100", "px-2", "py-1", "rounded", "mr-1"], ["colspan", "4", 1, "text-center", "py-4", "text-muted-color"], [1, "pi", "pi-exclamation-circle", "mr-1"]], template: function TranslationListPage_Template(rf, ctx) { if (rf & 1) {
3055
- i0.ɵɵelementStart(0, "div", 3)(1, "div", 4)(2, "h2", 5);
3056
- i0.ɵɵtext(3);
3057
- i0.ɵɵpipe(4, "translate");
3058
- i0.ɵɵelementEnd();
3059
- i0.ɵɵelementStart(5, "div", 6)(6, "p-button", 7);
3060
- i0.ɵɵpipe(7, "translate");
3061
- i0.ɵɵlistener("onClick", function TranslationListPage_Template_p_button_onClick_6_listener() { return ctx.saveChanges(); });
3062
- i0.ɵɵelementEnd()()();
3063
- i0.ɵɵelementStart(8, "div", 8)(9, "div", 9)(10, "label", 10);
3064
- i0.ɵɵtext(11);
3065
- i0.ɵɵpipe(12, "translate");
3066
- i0.ɵɵelementEnd();
3067
- i0.ɵɵelementStart(13, "p-select", 11);
3068
- i0.ɵɵpipe(14, "translate");
3069
- i0.ɵɵlistener("ngModelChange", function TranslationListPage_Template_p_select_ngModelChange_13_listener($event) { return ctx.onModuleChange($event); });
3070
- i0.ɵɵelementEnd()();
3071
- i0.ɵɵelementStart(15, "div", 9)(16, "label", 10);
3072
- i0.ɵɵtext(17);
3073
- i0.ɵɵpipe(18, "translate");
3074
- i0.ɵɵelementEnd();
3075
- i0.ɵɵelementStart(19, "p-select", 11);
3076
- i0.ɵɵpipe(20, "translate");
3077
- i0.ɵɵlistener("ngModelChange", function TranslationListPage_Template_p_select_ngModelChange_19_listener($event) { return ctx.onLanguageChange($event); });
3078
- i0.ɵɵelementEnd()();
3079
- i0.ɵɵelementStart(21, "div", 9)(22, "label", 10);
3080
- i0.ɵɵtext(23);
3081
- i0.ɵɵpipe(24, "translate");
3082
- i0.ɵɵelementEnd();
3083
- i0.ɵɵelementStart(25, "p-iconfield", 12);
3084
- i0.ɵɵelement(26, "p-inputicon", 13);
3085
- i0.ɵɵelementStart(27, "input", 14);
3086
- i0.ɵɵpipe(28, "translate");
3087
- i0.ɵɵlistener("ngModelChange", function TranslationListPage_Template_input_ngModelChange_27_listener($event) { return ctx.searchTerm.set($event); });
3088
- i0.ɵɵelementEnd()()()();
3089
- i0.ɵɵconditionalCreate(29, TranslationListPage_Conditional_29_Template, 2, 0, "div", 15)(30, TranslationListPage_Conditional_30_Template, 4, 3, "div", 16)(31, TranslationListPage_Conditional_31_Template, 4, 3, "div", 16)(32, TranslationListPage_Conditional_32_Template, 7, 7, "p-table", 17);
3090
- i0.ɵɵelementStart(33, "div", 18)(34, "div", 19);
3091
- i0.ɵɵconditionalCreate(35, TranslationListPage_Conditional_35_Template, 4, 6, "span", 20);
3092
- i0.ɵɵelementEnd();
3093
- i0.ɵɵelementStart(36, "p-button", 7);
3094
- i0.ɵɵpipe(37, "translate");
3095
- i0.ɵɵlistener("onClick", function TranslationListPage_Template_p_button_onClick_36_listener() { return ctx.saveChanges(); });
3096
- i0.ɵɵelementEnd()()();
3097
- i0.ɵɵelement(38, "p-toast");
3098
- } if (rf & 2) {
3099
- i0.ɵɵadvance(3);
3100
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 23, "localization.translation.title"));
3101
- i0.ɵɵadvance(3);
3102
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(7, 25, "shared.save"))("disabled", !ctx.hasChanges())("loading", ctx.isSaving());
3103
- i0.ɵɵadvance(5);
3104
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 27, "localization.translation.module"));
3105
- i0.ɵɵadvance(2);
3106
- i0.ɵɵproperty("options", ctx.moduleOptions())("ngModel", ctx.selectedModule())("ngModelOptions", i0.ɵɵpureFunction0(41, _c0))("placeholder", i0.ɵɵpipeBind1(14, 29, "localization.translation.select.module"));
3107
- i0.ɵɵadvance(4);
3108
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 31, "localization.translation.language"));
3109
- i0.ɵɵadvance(2);
3110
- i0.ɵɵproperty("options", ctx.languageOptions())("ngModel", ctx.selectedLanguageId())("ngModelOptions", i0.ɵɵpureFunction0(42, _c0))("placeholder", i0.ɵɵpipeBind1(20, 33, "localization.translation.select.language"));
3111
- i0.ɵɵadvance(4);
3112
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(24, 35, "shared.search"));
3113
- i0.ɵɵadvance(4);
3114
- i0.ɵɵproperty("ngModel", ctx.searchTerm())("ngModelOptions", i0.ɵɵpureFunction0(43, _c0))("placeholder", i0.ɵɵpipeBind1(28, 37, "localization.translation.search.keys"));
3115
- i0.ɵɵadvance(2);
3116
- i0.ɵɵconditional(ctx.isLoading() ? 29 : !ctx.selectedLanguageId() ? 30 : ctx.filteredRows().length === 0 ? 31 : 32);
3117
- i0.ɵɵadvance(6);
3118
- i0.ɵɵconditional(ctx.hasChanges() ? 35 : -1);
3119
- i0.ɵɵadvance();
3120
- i0.ɵɵproperty("label", i0.ɵɵpipeBind1(37, 39, "shared.save"))("disabled", !ctx.hasChanges())("loading", ctx.isSaving());
3121
- } }, dependencies: [AngularModule, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgModel, PrimeModule, i2.Button, i3$1.Checkbox, i4$2.IconField, i5$1.InputIcon, i4$1.InputText, i5.Select, i8.Table, i7.Textarea, i10.Toast, i9.ProgressSpinner, FormsModule, TranslatePipe], encapsulation: 2 });
2684
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationListPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
2685
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: TranslationListPage, isStandalone: true, selector: "lib-translation-list-page", providers: [MessageService], ngImport: i0, template: `
2686
+ <div class="card">
2687
+ <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-4">
2688
+ <h2 class="text-xl font-semibold m-0">{{ 'localization.translation.title' | translate }}</h2>
2689
+ <div class="flex gap-2">
2690
+ <p-button
2691
+ [label]="'shared.save' | translate"
2692
+ icon="pi pi-save"
2693
+ [disabled]="!hasChanges()"
2694
+ [loading]="isSaving()"
2695
+ (onClick)="saveChanges()"
2696
+ />
2697
+ </div>
2698
+ </div>
2699
+
2700
+ <div class="flex flex-col md:flex-row gap-4 mb-4">
2701
+ <div class="flex-1">
2702
+ <label class="block font-medium mb-2">{{ 'localization.translation.module' | translate }}</label>
2703
+ <p-select
2704
+ [options]="moduleOptions()"
2705
+ [ngModel]="selectedModule()"
2706
+ (ngModelChange)="onModuleChange($event)"
2707
+ [ngModelOptions]="{standalone: true}"
2708
+ optionLabel="label"
2709
+ optionValue="value"
2710
+ [placeholder]="'localization.translation.select.module' | translate"
2711
+ class="w-full"
2712
+ />
2713
+ </div>
2714
+ <div class="flex-1">
2715
+ <label class="block font-medium mb-2">{{ 'localization.translation.language' | translate }}</label>
2716
+ <p-select
2717
+ [options]="languageOptions()"
2718
+ [ngModel]="selectedLanguageId()"
2719
+ (ngModelChange)="onLanguageChange($event)"
2720
+ [ngModelOptions]="{standalone: true}"
2721
+ optionLabel="label"
2722
+ optionValue="value"
2723
+ [placeholder]="'localization.translation.select.language' | translate"
2724
+ class="w-full"
2725
+ />
2726
+ </div>
2727
+ <div class="flex-1">
2728
+ <label class="block font-medium mb-2">{{ 'shared.search' | translate }}</label>
2729
+ <p-iconfield class="w-full">
2730
+ <p-inputicon class="pi pi-search" />
2731
+ <input
2732
+ pInputText
2733
+ [ngModel]="searchTerm()"
2734
+ (ngModelChange)="searchTerm.set($event)"
2735
+ [ngModelOptions]="{standalone: true}"
2736
+ [placeholder]="'localization.translation.search.keys' | translate"
2737
+ class="w-full"
2738
+ />
2739
+ </p-iconfield>
2740
+ </div>
2741
+ </div>
2742
+
2743
+ @if (isLoading()) {
2744
+ <div class="flex justify-center py-8">
2745
+ <p-progressSpinner strokeWidth="4" />
2746
+ </div>
2747
+ } @else if (!selectedLanguageId()) {
2748
+ <div class="text-center py-8 text-muted-color">
2749
+ <p>{{ 'localization.translation.select.language.hint' | translate }}</p>
2750
+ </div>
2751
+ } @else if (filteredRows().length === 0) {
2752
+ <div class="text-center py-8 text-muted-color">
2753
+ <p>{{ 'localization.translation.no.keys' | translate }}</p>
2754
+ </div>
2755
+ } @else {
2756
+ <p-table
2757
+ [value]="filteredRows()"
2758
+ [paginator]="true"
2759
+ [rows]="20"
2760
+ [rowsPerPageOptions]="[10, 20, 50, 100]"
2761
+ [showCurrentPageReport]="true"
2762
+ [currentPageReportTemplate]="paginationTemplate()"
2763
+ styleClass="p-datatable-sm"
2764
+ >
2765
+ <ng-template #header>
2766
+ <tr>
2767
+ <th style="width: 30%">{{ 'localization.translation.key' | translate }}</th>
2768
+ <th style="width: 25%">{{ 'localization.translation.default.message' | translate }}</th>
2769
+ <th style="width: 35%">{{ 'localization.translation.value' | translate }}</th>
2770
+ <th style="width: 10%">{{ 'localization.translation.verified' | translate }}</th>
2771
+ </tr>
2772
+ </ng-template>
2773
+ <ng-template #body let-row>
2774
+ <tr [class.bg-yellow-50]="row.isDirty">
2775
+ <td>
2776
+ <div class="font-medium text-sm">{{ row.translationKey.key }}</div>
2777
+ @if (row.translationKey.description) {
2778
+ <small class="text-muted-color">{{ row.translationKey.description }}</small>
2779
+ }
2780
+ @if (row.translationKey.variables?.length) {
2781
+ <div class="mt-1">
2782
+ @for (v of row.translationKey.variables; track v) {
2783
+ <span class="text-xs bg-surface-100 px-2 py-1 rounded mr-1">{{ formatVariable(v) }}</span>
2784
+ }
2785
+ </div>
2786
+ }
2787
+ </td>
2788
+ <td>
2789
+ <span class="text-sm">{{ row.translationKey.defaultMessage }}</span>
2790
+ </td>
2791
+ <td>
2792
+ <textarea
2793
+ pInputTextarea
2794
+ [(ngModel)]="row.editValue"
2795
+ [ngModelOptions]="{standalone: true}"
2796
+ [rows]="2"
2797
+ class="w-full"
2798
+ [placeholder]="row.translationKey.defaultMessage"
2799
+ (input)="onValueChange(row)"
2800
+ ></textarea>
2801
+ </td>
2802
+ <td class="text-center">
2803
+ <p-checkbox
2804
+ [(ngModel)]="row.isVerified"
2805
+ [ngModelOptions]="{standalone: true}"
2806
+ [binary]="true"
2807
+ (onChange)="onVerifiedChange(row)"
2808
+ />
2809
+ </td>
2810
+ </tr>
2811
+ </ng-template>
2812
+ <ng-template #emptymessage>
2813
+ <tr>
2814
+ <td colspan="4" class="text-center py-4 text-muted-color">
2815
+ {{ 'shared.no.results' | translate }}
2816
+ </td>
2817
+ </tr>
2818
+ </ng-template>
2819
+ </p-table>
2820
+ }
2821
+
2822
+ <div class="flex justify-between items-center mt-4">
2823
+ <div class="text-muted-color">
2824
+ @if (hasChanges()) {
2825
+ <span class="text-orange-500">
2826
+ <i class="pi pi-exclamation-circle mr-1"></i>
2827
+ {{ 'localization.translation.unsaved.changes' | translate: { count: changedCount() } }}
2828
+ </span>
2829
+ }
2830
+ </div>
2831
+ <p-button
2832
+ [label]="'shared.save' | translate"
2833
+ icon="pi pi-save"
2834
+ [disabled]="!hasChanges()"
2835
+ [loading]="isSaving()"
2836
+ (onClick)="saveChanges()"
2837
+ />
2838
+ </div>
2839
+ </div>
2840
+
2841
+ <p-toast />
2842
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: i4$2.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i5$1.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "directive", type: i4$1.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: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i7.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "component", type: i10.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: "pipe", type: TranslatePipe, name: "translate" }] });
3122
2843
  }
3123
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TranslationListPage, [{
3124
- type: Component,
3125
- args: [{
3126
- selector: 'lib-translation-list-page',
3127
- imports: [AngularModule, PrimeModule, FormsModule, TranslatePipe],
3128
- providers: [MessageService],
3129
- template: `
2844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: TranslationListPage, decorators: [{
2845
+ type: Component,
2846
+ args: [{
2847
+ selector: 'lib-translation-list-page',
2848
+ imports: [AngularModule, PrimeModule, FormsModule, TranslatePipe],
2849
+ providers: [MessageService],
2850
+ template: `
3130
2851
  <div class="card">
3131
2852
  <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-4">
3132
2853
  <h2 class="text-xl font-semibold m-0">{{ 'localization.translation.title' | translate }}</h2>
@@ -3284,9 +3005,8 @@ class TranslationListPage {
3284
3005
 
3285
3006
  <p-toast />
3286
3007
  `,
3287
- }]
3288
- }], null, null); })();
3289
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TranslationListPage, { className: "TranslationListPage", filePath: "pages/translation-list/translation-list.page.ts", lineNumber: 193 }); })();
3008
+ }]
3009
+ }] });
3290
3010
 
3291
3011
  var translationList_page = /*#__PURE__*/Object.freeze({
3292
3012
  __proto__: null,