@libs-ui/components-inputs-multi-language 0.2.356-23 → 0.2.356-25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, signal, computed, input, model, output, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { Pipe, signal, computed, viewChildren, input, model, output, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
4
4
  import { LibsUiComponentsDropdownComponent } from '@libs-ui/components-dropdown';
5
- import { LibsUiComponentsInputsQuillComponent } from '@libs-ui/components-inputs-quill';
5
+ import { LibsUiComponentsInputsQuill2xComponent } from '@libs-ui/components-inputs-quill2x';
6
6
  import { LibsUiComponentsInputsValidComponent } from '@libs-ui/components-inputs-valid';
7
7
  import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
8
8
  import { LibsUiPipesEscapeHtmlPipe } from '@libs-ui/pipes-escape-html';
@@ -22,7 +22,7 @@ class LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe {
22
22
  if (!result) {
23
23
  return CHARACTER_DATA_EMPTY;
24
24
  }
25
- return `${result.label}: `;
25
+ return `${result.label}:`;
26
26
  }
27
27
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
28
28
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, isStandalone: true, name: "LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe" });
@@ -478,7 +478,6 @@ const validRequired = () => {
478
478
 
479
479
  /* eslint-disable @typescript-eslint/no-explicit-any */
480
480
  class LibsUiComponentsInputsMultiLanguageComponent {
481
- // #region PROPERTY
482
481
  languageDisplay = signal([]);
483
482
  dataLanguageChange = signal({});
484
483
  langDefault = signal(languageSupport());
@@ -487,10 +486,9 @@ class LibsUiComponentsInputsMultiLanguageComponent {
487
486
  validRequiredDefault = signal(validRequired());
488
487
  listConfigItem = computed(() => listConfigItem(this.options()));
489
488
  httpRequestDetail = computed(() => httpRequestDetail(this.options()));
490
- inputFunctionControl = signal(new Map());
491
- quillFunctionControl = signal([]);
489
+ inputComponentRefs = viewChildren(LibsUiComponentsInputsValidComponent);
490
+ quillComponentRefs = viewChildren(LibsUiComponentsInputsQuill2xComponent);
492
491
  onDestroy = new Subject();
493
- // #region INPUT
494
492
  optionsLanguage = input(langOptions());
495
493
  zIndex = input();
496
494
  viewType = input('text', { transform: (value) => value ?? 'text' });
@@ -513,17 +511,16 @@ class LibsUiComponentsInputsMultiLanguageComponent {
513
511
  classIncludeKey = input('libs-ui-font-h4r');
514
512
  classIncludeValue = input('libs-ui-font-h4s');
515
513
  dataLanguage = model({});
516
- multiLine = input();
517
514
  readonly = input();
518
515
  acceptNegativeValue = input();
519
516
  valueUpDownNumber = input();
520
517
  maxValueNumber = input();
521
518
  onlyAcceptNegativeValue = input();
522
519
  validOneDefaultMultiLanguage = input();
523
- // #region OUTPUT
520
+ classIconAddLanguage = input('libs-ui-icon-add', { transform: (value) => value || 'libs-ui-icon-add' });
521
+ validPattern = input();
524
522
  outEventMultiLanguage = output();
525
523
  outChangeTypeLanguage = output();
526
- outFunctionsControl = output();
527
524
  outChangeValueInput = output();
528
525
  constructor() {
529
526
  effect(() => {
@@ -538,16 +535,18 @@ class LibsUiComponentsInputsMultiLanguageComponent {
538
535
  untracked(() => {
539
536
  if (viewType === 'integer') {
540
537
  this.langDefault.set(currenciesSupport());
541
- this.options.set(currenciesOptions());
542
- this.options().forEach((item) => {
543
- this.currencyUnits().push({
544
- label: item.label,
545
- id: item.key,
546
- type: item.label,
547
- });
548
- });
549
- this.currencyUnits.update((value) => [...value]);
538
+ const opts = currenciesOptions();
539
+ this.options.set(opts);
540
+ this.currencyUnits.set(opts.map((item) => ({
541
+ label: item.label,
542
+ id: item.key,
543
+ type: item.label,
544
+ })));
545
+ return;
550
546
  }
547
+ this.langDefault.set(languageSupport());
548
+ this.options.set(this.optionsLanguage());
549
+ this.currencyUnits.set([]);
551
550
  });
552
551
  });
553
552
  effect(() => {
@@ -555,20 +554,7 @@ class LibsUiComponentsInputsMultiLanguageComponent {
555
554
  const dataLanguage = this.dataLanguage();
556
555
  this.dataLanguageChange.set(cloneDeep(dataLanguage));
557
556
  this.generateData();
558
- const optionsSelected = new Set();
559
- Object.keys(this.dataLanguageChange()).forEach((key) => {
560
- if (this.options().find((item) => item.key === key)) {
561
- optionsSelected.add(key);
562
- }
563
- });
564
- if (this.langDefault().length) {
565
- this.langDefault().forEach((key) => {
566
- if (!isNil(get(this.dataLanguageChange, key))) {
567
- optionsSelected.add(key);
568
- }
569
- });
570
- }
571
- this.languageDisplay.set(Array.from(optionsSelected));
557
+ this.languageDisplay.set(this.computeLanguageDisplayKeys());
572
558
  });
573
559
  });
574
560
  effect(() => {
@@ -579,24 +565,23 @@ class LibsUiComponentsInputsMultiLanguageComponent {
579
565
  return;
580
566
  }
581
567
  const key = this.langDefault()[0];
582
- this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange, key) }));
568
+ this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange(), key) }));
583
569
  });
584
570
  });
585
571
  effect(() => {
586
- const validRequired = this.validRequired();
572
+ const validRequiredInput = this.validRequired();
587
573
  untracked(() => {
588
- if (!validRequired) {
574
+ if (!validRequiredInput) {
589
575
  return;
590
576
  }
591
- this.validRequiredDefault.update((value) => ({ ...value, isRequired: validRequired.isRequired }));
592
- if (!validRequired.isRequired) {
593
- this.validate();
577
+ this.validRequiredDefault.update((value) => ({ ...value, isRequired: validRequiredInput.isRequired }));
578
+ if (!validRequiredInput.isRequired) {
579
+ void this.validate();
594
580
  }
595
581
  });
596
582
  });
597
583
  }
598
584
  ngOnInit() {
599
- this.outFunctionsControl.emit(this.FunctionsControl);
600
585
  this.extendClass.update((value) => `${value || ''} ${this.viewPosition() === 'row' ? 'flex-row' : 'flex-col'}`);
601
586
  }
602
587
  get FunctionsControl() {
@@ -605,82 +590,94 @@ class LibsUiComponentsInputsMultiLanguageComponent {
605
590
  getData: this.getData.bind(this),
606
591
  };
607
592
  }
608
- async handlerInputFunctionControl(event, key) {
609
- this.inputFunctionControl().set(key, event);
610
- }
611
- async handlerQuillFunctionControl(event) {
612
- this.quillFunctionControl.update((items) => [...items, event]);
593
+ /** Các key ngôn ngữ / tiền tệ cần hiển thị theo dữ liệu + cấu hình options. */
594
+ computeLanguageDisplayKeys() {
595
+ const dc = this.dataLanguageChange();
596
+ const opts = this.options();
597
+ const langs = this.langDefault();
598
+ const selected = new Set();
599
+ for (const k of Object.keys(dc)) {
600
+ if (opts.some((o) => o.key === k)) {
601
+ selected.add(k);
602
+ }
603
+ }
604
+ for (const k of langs) {
605
+ if (!isNil(get(dc, k))) {
606
+ selected.add(k);
607
+ }
608
+ }
609
+ return Array.from(selected);
613
610
  }
614
- async handlerSelectChange(event, keyOld) {
611
+ handlerSelectChange(event, keyOld) {
615
612
  if (!event || event.key === keyOld) {
616
613
  return;
617
614
  }
618
615
  this.languageDisplay.update((value) => value.map((item) => (item === keyOld ? event.key : item)));
619
616
  delete this.dataLanguageChange()[keyOld];
620
617
  delete this.dataLanguage()[keyOld];
621
- this.setDefaultData(event.key);
618
+ void this.setDefaultData(event.key);
622
619
  }
623
- async handlerAddLanguage(event) {
620
+ handlerAddLanguage(event) {
624
621
  event.stopPropagation();
625
622
  const lang = this.options().find((item) => !this.languageDisplay().includes(item.key));
626
623
  if (!lang) {
627
624
  return;
628
625
  }
629
626
  this.languageDisplay.update((value) => [...value, lang.key]);
630
- this.setDefaultData(lang.key);
627
+ void this.setDefaultData(lang.key);
631
628
  if (this.options().length === this.languageDisplay().length) {
632
629
  this.ignoreAdd.set(true);
633
630
  }
634
631
  this.outEventMultiLanguage.emit({ action: 'add', data: this.dataLanguageChange() });
635
632
  }
636
- async handlerRemoveLanguage(event, key) {
633
+ handlerRemoveLanguage(event, key) {
637
634
  event.stopPropagation();
638
- this.ignoreAdd.set(true);
635
+ this.ignoreAdd.set(false);
639
636
  this.dataLanguageChange.update((value) => {
640
637
  delete value[key];
641
638
  return { ...value };
642
639
  });
643
- this.validateIsMultiKey();
640
+ void this.validateIsMultiKey();
644
641
  this.languageDisplay.update((value) => value.filter((item) => item !== key));
645
642
  this.outEventMultiLanguage.emit({ action: 'remove', data: this.dataLanguageChange() });
646
- this.inputFunctionControl().delete(key);
647
643
  }
648
- async getData() {
644
+ getData() {
649
645
  if (this.singleLanguage()) {
650
646
  const key = this.langDefault()[0];
651
- this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange, key) }));
647
+ this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange(), key) }));
652
648
  return this.dataLanguage();
653
649
  }
654
650
  if (this.data().length > 1) {
651
+ const defaultLang = this.langDefault()[0];
655
652
  for (const item of this.data()) {
656
- const lang = this.langDefault()[0];
657
- const key = item.keyBindData;
658
- const dataByKey = key ? get(this.dataLanguageChange, key) : undefined;
659
- if (key && dataByKey && lang && !get(dataByKey, lang) && !get(this.dataLanguageChange, lang)) {
653
+ const keyBind = item.keyBindData;
654
+ const dataByKey = keyBind ? get(this.dataLanguageChange(), keyBind) : undefined;
655
+ if (keyBind && dataByKey && defaultLang && !get(dataByKey, defaultLang) && !get(this.dataLanguageChange(), defaultLang)) {
660
656
  return {};
661
657
  }
662
658
  }
663
659
  }
664
660
  return this.dataLanguageChange();
665
661
  }
666
- async generateData() {
662
+ generateData() {
667
663
  const lang = this.langDefault()[0];
668
- if (this.data().length) {
669
- this.data().forEach((item, index) => {
664
+ const dataItems = this.data();
665
+ if (dataItems.length) {
666
+ dataItems.forEach((item, index) => {
670
667
  const key = item.keyBindData;
671
- if (!index && isNil(get(this.dataLanguageChange, lang))) {
672
- this.setDefaultData(lang);
668
+ if (!index && isNil(get(this.dataLanguageChange(), lang))) {
669
+ void this.setDefaultData(lang);
673
670
  return;
674
671
  }
675
- if (!key || !isNil(get(this.dataLanguageChange, key))) {
672
+ if (!key || !isNil(get(this.dataLanguageChange(), key))) {
676
673
  return;
677
674
  }
678
675
  this.dataLanguageChange.update((value) => ({ ...value, [key]: { [lang]: '' } }));
679
676
  });
680
677
  }
681
- if (!this.data().length) {
678
+ if (!dataItems.length) {
682
679
  if (!this.dataLanguage() || !Object.keys(this.dataLanguage()).length) {
683
- this.setDefaultData(lang);
680
+ void this.setDefaultData(lang);
684
681
  }
685
682
  this.data.set([
686
683
  {
@@ -692,19 +689,19 @@ class LibsUiComponentsInputsMultiLanguageComponent {
692
689
  ]);
693
690
  }
694
691
  }
695
- async setDefaultData(key) {
692
+ setDefaultData(key) {
696
693
  this.dataLanguageChange.update((value) => ({ ...value, [key]: '' }));
697
694
  this.dataLanguage.update((value) => ({ ...value, [key]: '' }));
698
695
  }
699
696
  async validate() {
700
697
  let valid = true;
701
- for (const control of this.inputFunctionControl().values()) {
702
- if (!(await control.checkIsValid())) {
698
+ for (const control of this.inputComponentRefs()) {
699
+ if (!(await control.FunctionsControl.checkIsValid())) {
703
700
  valid = false;
704
701
  }
705
702
  }
706
- for (const control of this.quillFunctionControl()) {
707
- if (!(await control.checkIsValid())) {
703
+ for (const quillCmp of this.quillComponentRefs()) {
704
+ if (!(await quillCmp.FunctionsControl.checkIsValid())) {
708
705
  valid = false;
709
706
  }
710
707
  }
@@ -712,9 +709,12 @@ class LibsUiComponentsInputsMultiLanguageComponent {
712
709
  return valid;
713
710
  }
714
711
  if (this.data().length === 1) {
715
- await this.validateDefault();
712
+ const defaultOk = await this.validateDefault();
713
+ if (!defaultOk) {
714
+ valid = false;
715
+ }
716
716
  }
717
- this.validateIsMultiKey();
717
+ await this.validateIsMultiKey();
718
718
  return valid;
719
719
  }
720
720
  async validateDefault() {
@@ -734,12 +734,12 @@ class LibsUiComponentsInputsMultiLanguageComponent {
734
734
  return valid;
735
735
  }
736
736
  for (const key of Object.keys(this.dataLanguageChange())) {
737
- if (key !== 'id' && key !== this.keyHeader() && get(this.dataLanguageChange, key) && key !== this.langDefault()[0]) {
737
+ if (key !== 'id' && key !== this.keyHeader() && get(this.dataLanguageChange(), key) && key !== this.langDefault()[0]) {
738
738
  this.validRequiredDefault.update((value) => ({ ...value, isRequired: true }));
739
739
  if (!(await this.checkValidInput())) {
740
740
  valid = false;
741
741
  }
742
- return;
742
+ return valid;
743
743
  }
744
744
  this.validRequiredDefault.update((value) => ({ ...value, isRequired: false }));
745
745
  if (!(await this.checkValidInput())) {
@@ -750,80 +750,90 @@ class LibsUiComponentsInputsMultiLanguageComponent {
750
750
  }
751
751
  async checkValidInput() {
752
752
  let valid = true;
753
- for (const control of this.inputFunctionControl().values()) {
754
- if (!(await control.checkIsValid())) {
753
+ for (const control of this.inputComponentRefs()) {
754
+ if (!(await control.FunctionsControl.checkIsValid())) {
755
755
  valid = false;
756
756
  }
757
757
  }
758
758
  return valid;
759
759
  }
760
+ /**
761
+ * Khi có nhiều `IDataItem` (nhiều field bind), cập nhật `validRequiredLangDefault` theo dữ liệu đã nhập.
762
+ * Giữ nguyên thứ tự điều kiện / nhánh như phiên bản trước (forEach async), nhưng await đúng để validate không kết thúc sớm.
763
+ */
760
764
  async validateIsMultiKey() {
761
- if (this.data().length > 1) {
762
- if (this.data()[0].validRequired?.isRequired) {
763
- return;
765
+ if (this.data().length <= 1) {
766
+ return;
767
+ }
768
+ if (this.data()[0].validRequired?.isRequired) {
769
+ return;
770
+ }
771
+ const dataItems = this.data();
772
+ const dc = this.dataLanguageChange();
773
+ for (const item of dataItems) {
774
+ if (!item.keyBindData) {
775
+ continue;
764
776
  }
765
- this.data().forEach((item) => {
766
- if (!item.keyBindData) {
767
- return;
768
- }
769
- Object.keys(get(this.dataLanguageChange, item.keyBindData)).forEach(async (keyBind) => {
770
- for (const key of Object.keys(this.dataLanguageChange())) {
771
- if (key === item.keyBindData || key === keyBind) {
772
- continue;
773
- }
774
- if (get(this.dataLanguageChange, key) && this.options().find((item) => item.key === key)) {
775
- this.data().forEach(async (config) => {
776
- if (config && config.validRequiredLangDefault) {
777
- config.validRequiredLangDefault.isRequired = true;
778
- await this.checkValidInput();
779
- }
780
- });
781
- return;
782
- }
783
- this.data().forEach(async (config) => {
784
- if (config && config.validRequiredLangDefault) {
785
- config.validRequiredLangDefault.isRequired = false;
777
+ const nested = get(dc, item.keyBindData);
778
+ if (!nested || typeof nested !== 'object') {
779
+ continue;
780
+ }
781
+ langKey: for (const langNestedKey of Object.keys(nested)) {
782
+ for (const topKey of Object.keys(dc)) {
783
+ if (topKey === item.keyBindData || topKey === langNestedKey) {
784
+ continue;
785
+ }
786
+ if (get(dc, topKey) && this.options().find((opt) => opt.key === topKey)) {
787
+ for (const config of dataItems) {
788
+ if (config?.validRequiredLangDefault) {
789
+ config.validRequiredLangDefault.isRequired = true;
786
790
  await this.checkValidInput();
787
791
  }
788
- });
789
- }
790
- const dataLanguageChangeByKeyBind = get(this.dataLanguageChange, keyBind);
791
- const dataLanguageChangeByKeyBindData = item.keyBindData ? get(this.dataLanguageChange, item.keyBindData) : undefined;
792
- if ((!dataLanguageChangeByKeyBind && !get(dataLanguageChangeByKeyBindData, keyBind)) || (dataLanguageChangeByKeyBind && get(dataLanguageChangeByKeyBindData, keyBind))) {
793
- return;
794
- }
795
- if (!dataLanguageChangeByKeyBind) {
796
- const dataFirst = this.data()[0];
797
- if (dataFirst && dataFirst.validRequiredLangDefault) {
798
- dataFirst.validRequiredLangDefault.isRequired = true;
799
- await this.checkValidInput();
800
792
  }
801
- return;
793
+ continue langKey;
802
794
  }
803
- if (!get(dataLanguageChangeByKeyBindData, keyBind)) {
804
- const dataSecond = this.data()[1];
805
- if (dataSecond && dataSecond.validRequiredLangDefault) {
806
- dataSecond.validRequiredLangDefault.isRequired = true;
795
+ for (const config of dataItems) {
796
+ if (config?.validRequiredLangDefault) {
797
+ config.validRequiredLangDefault.isRequired = false;
807
798
  await this.checkValidInput();
808
799
  }
809
- return;
810
800
  }
811
- });
812
- });
801
+ }
802
+ const dataLanguageChangeByKeyBind = get(dc, langNestedKey);
803
+ const dataByItemKey = item.keyBindData ? get(dc, item.keyBindData) : undefined;
804
+ if ((!dataLanguageChangeByKeyBind && !get(dataByItemKey, langNestedKey)) || (dataLanguageChangeByKeyBind && get(dataByItemKey, langNestedKey))) {
805
+ continue;
806
+ }
807
+ if (!dataLanguageChangeByKeyBind) {
808
+ const dataFirst = dataItems[0];
809
+ if (dataFirst?.validRequiredLangDefault) {
810
+ dataFirst.validRequiredLangDefault.isRequired = true;
811
+ await this.checkValidInput();
812
+ }
813
+ continue;
814
+ }
815
+ if (!get(dataByItemKey, langNestedKey)) {
816
+ const dataSecond = dataItems[1];
817
+ if (dataSecond?.validRequiredLangDefault) {
818
+ dataSecond.validRequiredLangDefault.isRequired = true;
819
+ await this.checkValidInput();
820
+ }
821
+ }
822
+ }
813
823
  }
814
824
  }
815
- async handlerInputChange() {
825
+ handlerInputChange() {
816
826
  this.outChangeValueInput.emit();
817
827
  timer(500)
818
828
  .pipe(takeUntil(this.onDestroy))
819
- .subscribe(() => this.validate());
829
+ .subscribe(() => void this.validate());
820
830
  }
821
831
  ngOnDestroy() {
822
832
  this.onDestroy.next();
823
833
  this.onDestroy.complete();
824
834
  }
825
835
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
826
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsInputsMultiLanguageComponent, isStandalone: true, selector: "libs_ui-components-inputs-multi_language", inputs: { optionsLanguage: { classPropertyName: "optionsLanguage", publicName: "optionsLanguage", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, singleLanguage: { classPropertyName: "singleLanguage", publicName: "singleLanguage", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, ignoreAdd: { classPropertyName: "ignoreAdd", publicName: "ignoreAdd", isSignal: true, isRequired: false, transformFunction: null }, titleField: { classPropertyName: "titleField", publicName: "titleField", isSignal: true, isRequired: false, transformFunction: null }, keyHeader: { classPropertyName: "keyHeader", publicName: "keyHeader", isSignal: true, isRequired: false, transformFunction: null }, textArea: { classPropertyName: "textArea", publicName: "textArea", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, extendClass: { classPropertyName: "extendClass", publicName: "extendClass", isSignal: true, isRequired: false, transformFunction: null }, extendClassContent: { classPropertyName: "extendClassContent", publicName: "extendClassContent", isSignal: true, isRequired: false, transformFunction: null }, viewPosition: { classPropertyName: "viewPosition", publicName: "viewPosition", isSignal: true, isRequired: false, transformFunction: null }, ignoreRemove: { classPropertyName: "ignoreRemove", publicName: "ignoreRemove", isSignal: true, isRequired: false, transformFunction: null }, validMaxLength: { classPropertyName: "validMaxLength", publicName: "validMaxLength", isSignal: true, isRequired: false, transformFunction: null }, validMinLength: { classPropertyName: "validMinLength", publicName: "validMinLength", isSignal: true, isRequired: false, transformFunction: null }, countCharacters: { classPropertyName: "countCharacters", publicName: "countCharacters", isSignal: true, isRequired: false, transformFunction: null }, viewContent: { classPropertyName: "viewContent", publicName: "viewContent", isSignal: true, isRequired: false, transformFunction: null }, classIncludeKey: { classPropertyName: "classIncludeKey", publicName: "classIncludeKey", isSignal: true, isRequired: false, transformFunction: null }, classIncludeValue: { classPropertyName: "classIncludeValue", publicName: "classIncludeValue", isSignal: true, isRequired: false, transformFunction: null }, dataLanguage: { classPropertyName: "dataLanguage", publicName: "dataLanguage", isSignal: true, isRequired: false, transformFunction: null }, multiLine: { classPropertyName: "multiLine", publicName: "multiLine", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, validOneDefaultMultiLanguage: { classPropertyName: "validOneDefaultMultiLanguage", publicName: "validOneDefaultMultiLanguage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", ignoreAdd: "ignoreAddChange", extendClass: "extendClassChange", dataLanguage: "dataLanguageChange", outEventMultiLanguage: "outEventMultiLanguage", outChangeTypeLanguage: "outChangeTypeLanguage", outFunctionsControl: "outFunctionsControl", outChangeValueInput: "outChangeValueInput" }, ngImport: i0, template: "<div class=\"w-full\">\n @if (titleField(); as titleField) {\n <div class=\"libs-ui-font-h6m mb-[4px]\">{{ titleField | translate }}</div>\n }\n @for (key of languageDisplay(); track key) {\n @if (!viewContent()) {\n <div\n [class.mt-[4px]]=\"!$first\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[8px]]=\"countCharacters() && !$first\">\n <div class=\"flex {{ extendClass() }}\">\n @if (!singleLanguage()) {\n <div>\n <libs_ui-components-dropdown\n [listConfig]=\"listConfigItem()\"\n [httpRequestDetailItemById]=\"httpRequestDetail()\"\n [listKeysDisable]=\"languageDisplay() | LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe: key\"\n [readonly]=\"$index === 0 || readonly()\"\n [listKeySelected]=\"key\"\n [zIndex]=\"zIndex()\"\n [classInclude]=\"'w-[150px]'\"\n [listHasButtonUnSelectOption]=\"false\"\n (outSelectKey)=\"handlerSelectChange($event, key)\" />\n </div>\n }\n <div\n class=\"flex relative p-0 {{ extendClassContent() }}\"\n [class.w-[calc(100%-150px)]]=\"!textArea() && !singleLanguage() && viewPosition() === 'row'\"\n [class.w-full]=\"textArea() || singleLanguage() || viewPosition() === 'column'\">\n @for (item of data(); track item) {\n @if ((item.type !== 'editor' && !item.isOneValue) || (item.isOneValue && $first)) {\n <div\n class=\"relative {{ item.classIncludeInput }}\"\n [class.w-full]=\"(singleLanguage() && !multiLine()) || readonly() || $first\"\n [class.w-[calc(100%-28px)]]=\"textArea() || (!singleLanguage() && multiLine())\"\n [class.w-[calc(100%-40px)]]=\"!textArea() && !singleLanguage() && !multiLine() && !readonly()\"\n [class.w-[calc(100%-70px)]]=\"!textArea() && !singleLanguage() && multiLine()\"\n [class.mt-[8px]]=\"viewPosition() === 'column'\"\n [class.ml-[12px]]=\"!singleLanguage() && !textArea() && viewPosition() === 'row'\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-valid\n [dataType]=\"item.type === 'number' ? 'int' : item.type === 'text' ? 'string' : item.type === 'bigint' ? 'bigint' : 'float'\"\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [labelConfig]=\"countCharacters() ? { classInclude: 'absolute -top-[20px]', required: true } : undefined\"\n [tagInput]=\"textArea() ? 'textarea' : 'input'\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"\n validOneDefaultMultiLanguage() ? { isRequired: validOneDefaultMultiLanguage() === key ? true : false} :\n ($index === 0 && data().length <= 1\n ? validRequiredDefault()\n : $index === 0 && data().length > 1 && item.validRequiredLangDefault\n ? item.validRequiredLangDefault\n : item.validRequired\n ? item.validRequired\n : validRequired() || { isRequired: false })\n \"\n [unitsRight]=\"currencyUnits()\"\n [keySelectedUnitRight]=\"key\"\n [readonly]=\"readonly()\"\n [showCount]=\"countCharacters()\"\n [maxLength]=\"validMaxLength().length ? validMaxLength().length : undefined\"\n [fixedFloat]=\"item.type === 'bigint' ? 4 : 14\"\n [validMinLength]=\"(validOneDefaultMultiLanguage() && validOneDefaultMultiLanguage() !== key && !itemMap()[key] ) ? undefined : { length: validMinLength()?.length || -1, message: 'i18n_minimum_length_number', interpolateParams: { number: validMinLength()?.length } }\"\n [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerInputFunctionControl($event, key)\" />\n }\n </div>\n }\n @if (item.type === 'editor') {\n <div class=\"w-[calc(100%-28px)]\">\n <div class=\"h-[250px]\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-quill\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [validRequired]=\"$index === 0 && data().length <= 1 ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [readonly]=\"readonly()\"\n (outFocus)=\"handlerInputChange()\"\n (outChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerQuillFunctionControl($event)\" />\n }\n </div>\n </div>\n }\n }\n @if ($index > 0 && data().length === 1 && !ignoreRemove() && !readonly()) {\n <div class=\"h-[32px] flex items-center ml-[16px]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemoveLanguage($event, key)\" />\n </div>\n }\n </div>\n </div>\n @if ($index === 0 && !singleLanguage() && options().length !== languageDisplay().length && viewType() !== 'integer' && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [label]=\"'i18n_add_language'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classInclude]=\"'!px-0 mt-[8px]'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n </div>\n }\n @if (viewContent()) {\n <div class=\"flex\">\n @if (singleLanguage()) {\n <div\n class=\"flex\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe: options()\" />\n </div>\n }\n <div\n class=\"w-[calc(100%-100px)]\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.flex]=\"!singleLanguage() || $first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeValue()\"\n [innerHTML]=\"(dataLanguageChange()[key] || dataLanguageChange()[key] === 0 ? dataLanguageChange()[key] + '' : '') | LibsUiPipesEscapeHtmlPipe\"\n [config]=\"{ zIndex: zIndex() }\" />\n </div>\n </div>\n }\n }\n @if (viewType() === 'integer' && !this.ignoreAdd() && !readonly()) {\n <libs_ui-components-buttons-button\n type=\"button-link-primary\"\n [classIconLeft]=\"'libs-ui-icon-add mr-[8px] text-[10px]'\"\n [classLabel]=\"'libs-ui-font-h5r'\"\n [classInclude]=\"'!pb-0'\"\n [label]=\"'i18n_add_currency'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "dropdownTemplateRefNotSearchNoData", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { kind: "component", type: LibsUiComponentsInputsValidComponent, selector: "libs_ui-components-inputs-valid", inputs: ["item", "labelConfig", "emitEmptyInDataTypeNumber", "ignoreBlockInputMaxValue", "fieldNameBind", "showCount", "typeComponentSelectItem", "valueComponentSelectItem", "disableComponentSelectItem", "tagInput", "dataType", "typeInput", "modeInput", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "ignoreShowMessageError", "borderError", "iconLeftClass", "popoverContentIconLeft", "iconRightClass", "popoverContentIconRight", "zIndexPopoverContent", "unitsLeft", "configUnitLeft", "keySelectedUnitLeft", "unitsRight", "configUnitRight", "keySelectedUnitRight", "maxValueNumber", "minValueNumber", "ignoreContentLeft", "ignoreContentRight", "isBaselineStyle", "valuePatternShowError", "validPattern", "validRequired", "validMinLength", "validMinValue", "validMaxValue", "validMaxLength", "functionValid", "maxLength", "positionMessageErrorStartInput", "classInclude", "resize", "templateLeftBottomInput", "templateRightBottomInput", "onlyAcceptNegativeValue", "autoAddZeroLessThan10InTypeInt", "maxLengthNumberCount", "classMessageErrorInclude", "ignoreStopPropagationEvent", "ignoreUnitRightClassReadOnly", "paddingRightCustomSpecific", "focusTimeOut", "debounceTimeValidate"], outputs: ["itemChange", "outValueChange", "outSelect", "outIconLeft", "outIconRight", "outClickButtonLabel", "outSwitchEventLabel", "outLabelRightClick", "outEnterInputEvent", "outHeightAreaChange", "outFunctionsControl", "outFocusAndBlur", "outChangeValueByButtonUpDown"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe, name: "LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, name: "LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetItemPipe, name: "LibsUiComponentsInputsMultiLanguageGetItemPipe" }, { kind: "pipe", type: LibsUiPipesEscapeHtmlPipe, name: "LibsUiPipesEscapeHtmlPipe" }, { kind: "component", type: LibsUiComponentsInputsQuillComponent, selector: "libs_ui-components-inputs-quill", inputs: ["isShowToolBar", "isToolbarPositionFixed", "classIncludeToolbar", "stylesIncludeToolbar", "toolbarConfig", "placeholder", "label", "item", "autoUpdateValueWhenTextChange", "fieldNameBind", "readonly", "showErrorLabel", "showErrorBorder", "onlyShowErrorBorderInContent", "classIncludeTemplate", "classInclude", "handlersExpand", "validRequired", "validMinLength", "validMaxLength", "zIndex", "dataConfigMention", "blotsRegister", "autoFocus", "focusBottom", "blockUndoRedoKeyboard", "templateToolBarPersonalize", "template", "uploadImageConfig", "heightAuto", "elementScrollHeightAuto", "ignoreShowPopupEditLink", "ignoreCommunicateMicroEventPopup"], outputs: ["itemChange", "outShowPopupEditLink", "outMessageError", "outBlur", "outFocus", "outChange", "outFunctionsControl", "outSelectionChange", "outTextChange", "outContextMenu"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
836
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsInputsMultiLanguageComponent, isStandalone: true, selector: "libs_ui-components-inputs-multi_language", inputs: { optionsLanguage: { classPropertyName: "optionsLanguage", publicName: "optionsLanguage", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, singleLanguage: { classPropertyName: "singleLanguage", publicName: "singleLanguage", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, ignoreAdd: { classPropertyName: "ignoreAdd", publicName: "ignoreAdd", isSignal: true, isRequired: false, transformFunction: null }, titleField: { classPropertyName: "titleField", publicName: "titleField", isSignal: true, isRequired: false, transformFunction: null }, keyHeader: { classPropertyName: "keyHeader", publicName: "keyHeader", isSignal: true, isRequired: false, transformFunction: null }, textArea: { classPropertyName: "textArea", publicName: "textArea", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, extendClass: { classPropertyName: "extendClass", publicName: "extendClass", isSignal: true, isRequired: false, transformFunction: null }, extendClassContent: { classPropertyName: "extendClassContent", publicName: "extendClassContent", isSignal: true, isRequired: false, transformFunction: null }, viewPosition: { classPropertyName: "viewPosition", publicName: "viewPosition", isSignal: true, isRequired: false, transformFunction: null }, ignoreRemove: { classPropertyName: "ignoreRemove", publicName: "ignoreRemove", isSignal: true, isRequired: false, transformFunction: null }, validMaxLength: { classPropertyName: "validMaxLength", publicName: "validMaxLength", isSignal: true, isRequired: false, transformFunction: null }, validMinLength: { classPropertyName: "validMinLength", publicName: "validMinLength", isSignal: true, isRequired: false, transformFunction: null }, countCharacters: { classPropertyName: "countCharacters", publicName: "countCharacters", isSignal: true, isRequired: false, transformFunction: null }, viewContent: { classPropertyName: "viewContent", publicName: "viewContent", isSignal: true, isRequired: false, transformFunction: null }, classIncludeKey: { classPropertyName: "classIncludeKey", publicName: "classIncludeKey", isSignal: true, isRequired: false, transformFunction: null }, classIncludeValue: { classPropertyName: "classIncludeValue", publicName: "classIncludeValue", isSignal: true, isRequired: false, transformFunction: null }, dataLanguage: { classPropertyName: "dataLanguage", publicName: "dataLanguage", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, validOneDefaultMultiLanguage: { classPropertyName: "validOneDefaultMultiLanguage", publicName: "validOneDefaultMultiLanguage", isSignal: true, isRequired: false, transformFunction: null }, classIconAddLanguage: { classPropertyName: "classIconAddLanguage", publicName: "classIconAddLanguage", isSignal: true, isRequired: false, transformFunction: null }, validPattern: { classPropertyName: "validPattern", publicName: "validPattern", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", ignoreAdd: "ignoreAddChange", extendClass: "extendClassChange", dataLanguage: "dataLanguageChange", outEventMultiLanguage: "outEventMultiLanguage", outChangeTypeLanguage: "outChangeTypeLanguage", outChangeValueInput: "outChangeValueInput" }, viewQueries: [{ propertyName: "inputComponentRefs", predicate: LibsUiComponentsInputsValidComponent, descendants: true, isSignal: true }, { propertyName: "quillComponentRefs", predicate: LibsUiComponentsInputsQuill2xComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"w-full flex flex-col gap-[8px]\">\n @if (titleField(); as titleField) {\n <div class=\"libs-ui-font-h6m\">{{ titleField | translate }}</div>\n }\n <div\n class=\"flex flex-col gap-[8px]\"\n [class.gap-[8px]]=\"viewPosition() === 'row'\"\n [class.gap-[16px]]=\"viewPosition() === 'column'\">\n @for (key of languageDisplay(); track key) {\n @if (!viewContent()) {\n <div class=\"flex gap-[8px] w-full {{ extendClass() }}\">\n @if (!singleLanguage()) {\n <div>\n <libs_ui-components-dropdown\n [listConfig]=\"listConfigItem()\"\n [httpRequestDetailItemById]=\"httpRequestDetail()\"\n [listKeysDisable]=\"languageDisplay() | LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe: key\"\n [readonly]=\"$index === 0 || readonly()\"\n [listKeySelected]=\"key\"\n [zIndex]=\"zIndex()\"\n [classInclude]=\"'w-[150px]'\"\n [listHiddenInputSearch]=\"true\"\n [listHasButtonUnSelectOption]=\"false\"\n (outSelectKey)=\"handlerSelectChange($event, key)\" />\n </div>\n }\n <div class=\"flex flex-1 gap-[12px] {{ extendClassContent() }}\">\n @for (item of data(); track item) {\n @if (item.type === 'editor') {\n <div class=\"w-full min-w-0\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-quill2x\n [(item)]=\"itemMap\"\n [fieldBind]=\"key\"\n [resize]=\"item.resize || 'vertical'\"\n [minHeightEditorContentDefault]=\"item.minHeightEditorContentDefault || 160\"\n [maxHeightEditorContentDefault]=\"item.maxHeightEditorContentDefault\"\n [heightEditorContentDefault]=\"item.heightEditorContentDefault\"\n [validRequired]=\"$index === 0 && data().length <= 1 ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [readonly]=\"readonly()\"\n (outFocus)=\"handlerInputChange()\"\n (outChange)=\"handlerInputChange()\" />\n }\n </div>\n } @else {\n <div class=\"w-full min-w-0 {{ item.classIncludeInput }}\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-valid\n [dataType]=\"item.type === 'number' ? 'int' : item.type === 'text' ? 'string' : item.type === 'bigint' ? 'bigint' : 'float'\"\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [tagInput]=\"textArea() ? 'textarea' : 'input'\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"\n validOneDefaultMultiLanguage()\n ? { isRequired: validOneDefaultMultiLanguage() === key ? true : false }\n : $index === 0 && data().length <= 1\n ? validRequiredDefault()\n : $index === 0 && data().length > 1 && item.validRequiredLangDefault\n ? item.validRequiredLangDefault\n : item.validRequired\n ? item.validRequired\n : validRequired() || { isRequired: false }\n \"\n [unitsRight]=\"currencyUnits()\"\n [keySelectedUnitRight]=\"key\"\n [readonly]=\"readonly()\"\n [showCount]=\"countCharacters()\"\n [maxLength]=\"validMaxLength().length ? validMaxLength().length : undefined\"\n [fixedFloat]=\"item.type === 'bigint' ? 4 : 14\"\n [validMinLength]=\"\n validOneDefaultMultiLanguage() && validOneDefaultMultiLanguage() !== key && !itemMap()[key]\n ? undefined\n : { length: validMinLength()?.length || -1, message: 'i18n_minimum_length_number', interpolateParams: { number: validMinLength()?.length } }\n \"\n [validPattern]=\"validPattern()\"\n [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\" />\n }\n </div>\n }\n }\n @if (!singleLanguage()) {\n <div\n class=\"flex items-center w-[16px] shrink-0\"\n [class.h-[32px]]=\"data()[0].type !== 'editor'\"\n [class.h-[44px]]=\"data()[0].type === 'editor'\">\n @if ($index > 0 && data().length === 1 && !ignoreRemove() && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#6a7383',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '#6a7383',\n },\n rootColor: '#6a7383',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemoveLanguage($event, key)\" />\n }\n @if ($index === 0 && options().length !== languageDisplay().length && viewType() !== 'integer' && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [iconOnlyType]=\"true\"\n [classIconLeft]=\"classIconAddLanguage()\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n </div>\n }\n </div>\n </div>\n }\n @if (viewContent()) {\n <div class=\"flex gap-[4px]\">\n @if (!singleLanguage()) {\n <div class=\"flex\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe: options()\" />\n </div>\n }\n <div class=\"flex flex-1 min-w-0\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeValue()\"\n [innerHTML]=\"(dataLanguageChange()[key] || dataLanguageChange()[key] === 0 ? dataLanguageChange()[key] + '' : '') | LibsUiPipesEscapeHtmlPipe\"\n [config]=\"{ zIndex: zIndex() }\" />\n </div>\n </div>\n }\n }\n </div>\n @if (viewType() === 'integer' && !this.ignoreAdd() && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classLabel]=\"'libs-ui-font-h6mi'\"\n [classInclude]=\"'!px-0 !py-[2px]'\"\n [label]=\"'i18n_add_new'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "dropdownTemplateRefNotSearchNoData", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { kind: "component", type: LibsUiComponentsInputsValidComponent, selector: "libs_ui-components-inputs-valid", inputs: ["item", "labelConfig", "emitEmptyInDataTypeNumber", "ignoreBlockInputMaxValue", "fieldNameBind", "showCount", "typeComponentSelectItem", "valueComponentSelectItem", "disableComponentSelectItem", "tagInput", "dataType", "typeInput", "modeInput", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "ignoreShowMessageError", "borderError", "iconLeftClass", "popoverContentIconLeft", "iconRightClass", "popoverContentIconRight", "zIndexPopoverContent", "unitsLeft", "configUnitLeft", "keySelectedUnitLeft", "unitsRight", "configUnitRight", "keySelectedUnitRight", "maxValueNumber", "minValueNumber", "ignoreContentLeft", "ignoreContentRight", "isBaselineStyle", "valuePatternShowError", "validPattern", "validRequired", "validMinLength", "validMinValue", "validMaxValue", "validMaxLength", "functionValid", "maxLength", "positionMessageErrorStartInput", "classInclude", "resize", "templateLeftBottomInput", "templateRightBottomInput", "onlyAcceptNegativeValue", "autoAddZeroLessThan10InTypeInt", "maxLengthNumberCount", "classMessageErrorInclude", "ignoreStopPropagationEvent", "ignoreUnitRightClassReadOnly", "paddingRightCustomSpecific", "focusTimeOut", "debounceTimeValidate"], outputs: ["itemChange", "outValueChange", "outSelect", "outIconLeft", "outIconRight", "outClickButtonLabel", "outSwitchEventLabel", "outLabelRightClick", "outEnterInputEvent", "outHeightAreaChange", "outFunctionsControl", "outFocusAndBlur", "outChangeValueByButtonUpDown"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe, name: "LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, name: "LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetItemPipe, name: "LibsUiComponentsInputsMultiLanguageGetItemPipe" }, { kind: "pipe", type: LibsUiPipesEscapeHtmlPipe, name: "LibsUiPipesEscapeHtmlPipe" }, { kind: "component", type: LibsUiComponentsInputsQuill2xComponent, selector: "libs_ui-components-inputs-quill2x", inputs: ["uploadImageConfig", "displayToolbar", "placeholder", "blotsRegister", "readonly", "quillCustomConfig", "label", "item", "fieldBind", "dataConfigMention", "templateToolBarPersonalize", "zIndex", "ignoreShowPopupEditLink", "ignoreCommunicateMicroEventPopup", "handlersExpand", "resizeImagePlugin", "fontSizeDefault", "heightEditorContentDefault", "minHeightEditorContentDefault", "maxHeightEditorContentDefault", "removeNearWhiteColorsOnPaste", "resize", "autoFocus", "focusTimerOnInit", "focusBottom", "validRequired", "validMinLength", "validMaxLength", "showErrorLabel", "showErrorBorder", "ignoreShowBorderErrorToolbar"], outputs: ["itemChange", "outShowPopupEditLink", "outMessageError", "outBlur", "outFocus", "outChange", "outSelectionChange", "outTextChange", "outContextMenu", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
827
837
  }
828
838
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageComponent, decorators: [{
829
839
  type: Component,
@@ -837,20 +847,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
837
847
  LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe,
838
848
  LibsUiComponentsInputsMultiLanguageGetItemPipe,
839
849
  LibsUiPipesEscapeHtmlPipe,
840
- LibsUiComponentsInputsQuillComponent,
841
- ], template: "<div class=\"w-full\">\n @if (titleField(); as titleField) {\n <div class=\"libs-ui-font-h6m mb-[4px]\">{{ titleField | translate }}</div>\n }\n @for (key of languageDisplay(); track key) {\n @if (!viewContent()) {\n <div\n [class.mt-[4px]]=\"!$first\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[8px]]=\"countCharacters() && !$first\">\n <div class=\"flex {{ extendClass() }}\">\n @if (!singleLanguage()) {\n <div>\n <libs_ui-components-dropdown\n [listConfig]=\"listConfigItem()\"\n [httpRequestDetailItemById]=\"httpRequestDetail()\"\n [listKeysDisable]=\"languageDisplay() | LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe: key\"\n [readonly]=\"$index === 0 || readonly()\"\n [listKeySelected]=\"key\"\n [zIndex]=\"zIndex()\"\n [classInclude]=\"'w-[150px]'\"\n [listHasButtonUnSelectOption]=\"false\"\n (outSelectKey)=\"handlerSelectChange($event, key)\" />\n </div>\n }\n <div\n class=\"flex relative p-0 {{ extendClassContent() }}\"\n [class.w-[calc(100%-150px)]]=\"!textArea() && !singleLanguage() && viewPosition() === 'row'\"\n [class.w-full]=\"textArea() || singleLanguage() || viewPosition() === 'column'\">\n @for (item of data(); track item) {\n @if ((item.type !== 'editor' && !item.isOneValue) || (item.isOneValue && $first)) {\n <div\n class=\"relative {{ item.classIncludeInput }}\"\n [class.w-full]=\"(singleLanguage() && !multiLine()) || readonly() || $first\"\n [class.w-[calc(100%-28px)]]=\"textArea() || (!singleLanguage() && multiLine())\"\n [class.w-[calc(100%-40px)]]=\"!textArea() && !singleLanguage() && !multiLine() && !readonly()\"\n [class.w-[calc(100%-70px)]]=\"!textArea() && !singleLanguage() && multiLine()\"\n [class.mt-[8px]]=\"viewPosition() === 'column'\"\n [class.ml-[12px]]=\"!singleLanguage() && !textArea() && viewPosition() === 'row'\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-valid\n [dataType]=\"item.type === 'number' ? 'int' : item.type === 'text' ? 'string' : item.type === 'bigint' ? 'bigint' : 'float'\"\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [labelConfig]=\"countCharacters() ? { classInclude: 'absolute -top-[20px]', required: true } : undefined\"\n [tagInput]=\"textArea() ? 'textarea' : 'input'\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"\n validOneDefaultMultiLanguage() ? { isRequired: validOneDefaultMultiLanguage() === key ? true : false} :\n ($index === 0 && data().length <= 1\n ? validRequiredDefault()\n : $index === 0 && data().length > 1 && item.validRequiredLangDefault\n ? item.validRequiredLangDefault\n : item.validRequired\n ? item.validRequired\n : validRequired() || { isRequired: false })\n \"\n [unitsRight]=\"currencyUnits()\"\n [keySelectedUnitRight]=\"key\"\n [readonly]=\"readonly()\"\n [showCount]=\"countCharacters()\"\n [maxLength]=\"validMaxLength().length ? validMaxLength().length : undefined\"\n [fixedFloat]=\"item.type === 'bigint' ? 4 : 14\"\n [validMinLength]=\"(validOneDefaultMultiLanguage() && validOneDefaultMultiLanguage() !== key && !itemMap()[key] ) ? undefined : { length: validMinLength()?.length || -1, message: 'i18n_minimum_length_number', interpolateParams: { number: validMinLength()?.length } }\"\n [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerInputFunctionControl($event, key)\" />\n }\n </div>\n }\n @if (item.type === 'editor') {\n <div class=\"w-[calc(100%-28px)]\">\n <div class=\"h-[250px]\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-quill\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [validRequired]=\"$index === 0 && data().length <= 1 ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [readonly]=\"readonly()\"\n (outFocus)=\"handlerInputChange()\"\n (outChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerQuillFunctionControl($event)\" />\n }\n </div>\n </div>\n }\n }\n @if ($index > 0 && data().length === 1 && !ignoreRemove() && !readonly()) {\n <div class=\"h-[32px] flex items-center ml-[16px]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemoveLanguage($event, key)\" />\n </div>\n }\n </div>\n </div>\n @if ($index === 0 && !singleLanguage() && options().length !== languageDisplay().length && viewType() !== 'integer' && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [label]=\"'i18n_add_language'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classInclude]=\"'!px-0 mt-[8px]'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n </div>\n }\n @if (viewContent()) {\n <div class=\"flex\">\n @if (singleLanguage()) {\n <div\n class=\"flex\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe: options()\" />\n </div>\n }\n <div\n class=\"w-[calc(100%-100px)]\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.flex]=\"!singleLanguage() || $first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeValue()\"\n [innerHTML]=\"(dataLanguageChange()[key] || dataLanguageChange()[key] === 0 ? dataLanguageChange()[key] + '' : '') | LibsUiPipesEscapeHtmlPipe\"\n [config]=\"{ zIndex: zIndex() }\" />\n </div>\n </div>\n }\n }\n @if (viewType() === 'integer' && !this.ignoreAdd() && !readonly()) {\n <libs_ui-components-buttons-button\n type=\"button-link-primary\"\n [classIconLeft]=\"'libs-ui-icon-add mr-[8px] text-[10px]'\"\n [classLabel]=\"'libs-ui-font-h5r'\"\n [classInclude]=\"'!pb-0'\"\n [label]=\"'i18n_add_currency'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n</div>\n" }]
850
+ LibsUiComponentsInputsQuill2xComponent,
851
+ ], template: "<div class=\"w-full flex flex-col gap-[8px]\">\n @if (titleField(); as titleField) {\n <div class=\"libs-ui-font-h6m\">{{ titleField | translate }}</div>\n }\n <div\n class=\"flex flex-col gap-[8px]\"\n [class.gap-[8px]]=\"viewPosition() === 'row'\"\n [class.gap-[16px]]=\"viewPosition() === 'column'\">\n @for (key of languageDisplay(); track key) {\n @if (!viewContent()) {\n <div class=\"flex gap-[8px] w-full {{ extendClass() }}\">\n @if (!singleLanguage()) {\n <div>\n <libs_ui-components-dropdown\n [listConfig]=\"listConfigItem()\"\n [httpRequestDetailItemById]=\"httpRequestDetail()\"\n [listKeysDisable]=\"languageDisplay() | LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe: key\"\n [readonly]=\"$index === 0 || readonly()\"\n [listKeySelected]=\"key\"\n [zIndex]=\"zIndex()\"\n [classInclude]=\"'w-[150px]'\"\n [listHiddenInputSearch]=\"true\"\n [listHasButtonUnSelectOption]=\"false\"\n (outSelectKey)=\"handlerSelectChange($event, key)\" />\n </div>\n }\n <div class=\"flex flex-1 gap-[12px] {{ extendClassContent() }}\">\n @for (item of data(); track item) {\n @if (item.type === 'editor') {\n <div class=\"w-full min-w-0\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-quill2x\n [(item)]=\"itemMap\"\n [fieldBind]=\"key\"\n [resize]=\"item.resize || 'vertical'\"\n [minHeightEditorContentDefault]=\"item.minHeightEditorContentDefault || 160\"\n [maxHeightEditorContentDefault]=\"item.maxHeightEditorContentDefault\"\n [heightEditorContentDefault]=\"item.heightEditorContentDefault\"\n [validRequired]=\"$index === 0 && data().length <= 1 ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [readonly]=\"readonly()\"\n (outFocus)=\"handlerInputChange()\"\n (outChange)=\"handlerInputChange()\" />\n }\n </div>\n } @else {\n <div class=\"w-full min-w-0 {{ item.classIncludeInput }}\">\n @if (item.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: dataLanguageChange; as itemMap) {\n @let constHtmlPlaceholder = item.placeholder || ' ';\n <libs_ui-components-inputs-valid\n [dataType]=\"item.type === 'number' ? 'int' : item.type === 'text' ? 'string' : item.type === 'bigint' ? 'bigint' : 'float'\"\n [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [tagInput]=\"textArea() ? 'textarea' : 'input'\"\n [placeholder]=\"constHtmlPlaceholder | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"\n validOneDefaultMultiLanguage()\n ? { isRequired: validOneDefaultMultiLanguage() === key ? true : false }\n : $index === 0 && data().length <= 1\n ? validRequiredDefault()\n : $index === 0 && data().length > 1 && item.validRequiredLangDefault\n ? item.validRequiredLangDefault\n : item.validRequired\n ? item.validRequired\n : validRequired() || { isRequired: false }\n \"\n [unitsRight]=\"currencyUnits()\"\n [keySelectedUnitRight]=\"key\"\n [readonly]=\"readonly()\"\n [showCount]=\"countCharacters()\"\n [maxLength]=\"validMaxLength().length ? validMaxLength().length : undefined\"\n [fixedFloat]=\"item.type === 'bigint' ? 4 : 14\"\n [validMinLength]=\"\n validOneDefaultMultiLanguage() && validOneDefaultMultiLanguage() !== key && !itemMap()[key]\n ? undefined\n : { length: validMinLength()?.length || -1, message: 'i18n_minimum_length_number', interpolateParams: { number: validMinLength()?.length } }\n \"\n [validPattern]=\"validPattern()\"\n [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\" />\n }\n </div>\n }\n }\n @if (!singleLanguage()) {\n <div\n class=\"flex items-center w-[16px] shrink-0\"\n [class.h-[32px]]=\"data()[0].type !== 'editor'\"\n [class.h-[44px]]=\"data()[0].type === 'editor'\">\n @if ($index > 0 && data().length === 1 && !ignoreRemove() && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#6a7383',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '#6a7383',\n },\n rootColor: '#6a7383',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemoveLanguage($event, key)\" />\n }\n @if ($index === 0 && options().length !== languageDisplay().length && viewType() !== 'integer' && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-third'\"\n [iconOnlyType]=\"true\"\n [classIconLeft]=\"classIconAddLanguage()\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n </div>\n }\n </div>\n </div>\n }\n @if (viewContent()) {\n <div class=\"flex gap-[4px]\">\n @if (!singleLanguage()) {\n <div class=\"flex\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe: options()\" />\n </div>\n }\n <div class=\"flex flex-1 min-w-0\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"classIncludeValue()\"\n [innerHTML]=\"(dataLanguageChange()[key] || dataLanguageChange()[key] === 0 ? dataLanguageChange()[key] + '' : '') | LibsUiPipesEscapeHtmlPipe\"\n [config]=\"{ zIndex: zIndex() }\" />\n </div>\n </div>\n }\n }\n </div>\n @if (viewType() === 'integer' && !this.ignoreAdd() && !readonly()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classLabel]=\"'libs-ui-font-h6mi'\"\n [classInclude]=\"'!px-0 !py-[2px]'\"\n [label]=\"'i18n_add_new'\"\n (outClick)=\"handlerAddLanguage($event)\" />\n }\n</div>\n" }]
842
852
  }], ctorParameters: () => [] });
843
853
 
844
854
  class LibsUiComponentsInputsMultiLanguageItemsComponent {
845
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
846
855
  dataMultiKey = signal([]);
847
856
  langDefault = signal(UtilsCache.getLang());
848
857
  configHeader = signal(undefined);
849
858
  validRequired = signal({ isRequired: false });
850
859
  validRequiredWhenInputHasValue = signal(undefined);
851
860
  dataHeader = signal(undefined);
852
- multiLanguageFunctionControl = signal([]);
853
- inputValidFunctionControl = signal([]);
861
+ inputComponentRefs = viewChildren(LibsUiComponentsInputsValidComponent);
862
+ multiLanguageComponentRefs = viewChildren(LibsUiComponentsInputsMultiLanguageComponent);
854
863
  configItems = input([]);
855
864
  dataMultiLanguage = model([{}]);
856
865
  zIndex = input();
@@ -861,125 +870,113 @@ class LibsUiComponentsInputsMultiLanguageItemsComponent {
861
870
  valueUpDownNumber = input();
862
871
  maxValueNumber = input();
863
872
  onlyAcceptNegativeValue = input();
864
- outClick = output();
865
- outFunctionControl = output();
873
+ classIconAddLanguage = input('libs-ui-icon-add', { transform: (value) => value || 'libs-ui-icon-add' });
866
874
  outChangeValue = output();
867
875
  constructor() {
868
876
  effect(() => {
869
- const configItems = this.configItems();
877
+ const items = this.configItems();
870
878
  untracked(() => {
871
- if (configItems && configItems.length) {
872
- this.configHeader.set(configItems[0].header);
873
- }
879
+ this.configHeader.set(items?.[0]?.header);
880
+ this.validRequired.set(items?.[0]?.validRequired ?? { isRequired: false });
881
+ this.syncDataMultiKey();
874
882
  });
875
883
  });
876
884
  effect(() => {
877
- const dataMultiLanguage = this.dataMultiLanguage();
885
+ const rows = this.dataMultiLanguage();
878
886
  untracked(() => {
879
- if (!dataMultiLanguage || !dataMultiLanguage.length) {
880
- this.dataMultiLanguage.set([{}]);
881
- const configHeader = this.configHeader();
882
- if (configHeader && configHeader.dataDefault) {
883
- this.dataMultiLanguage.set([cloneDeep(configHeader.dataDefault)]);
884
- }
887
+ if (!rows?.length) {
888
+ const header = this.configHeader();
889
+ const initial = header?.dataDefault ? cloneDeep(header.dataDefault) : {};
890
+ this.dataMultiLanguage.set([initial]);
885
891
  }
886
- this.handlerConfigMulti();
892
+ this.syncDataMultiKey();
887
893
  });
888
894
  });
889
895
  }
890
- ngOnInit() {
891
- this.outFunctionControl.emit(this.FunctionsControl);
892
- const configItems = this.configItems();
893
- if (configItems && configItems.length && configItems[0].validRequired) {
894
- this.validRequired.set(configItems[0].validRequired);
895
- }
896
- }
897
896
  get FunctionsControl() {
898
897
  return {
899
898
  checkIsValid: this.validate.bind(this),
900
899
  getData: this.getData.bind(this),
901
900
  };
902
901
  }
903
- async handlerConfigMulti() {
904
- this.dataMultiKey.set([]);
905
- this.dataMultiLanguage().forEach(() => {
906
- const configItems = this.configItems();
907
- if (configItems) {
908
- this.dataMultiKey().push(configItems);
909
- }
910
- });
911
- this.dataMultiKey.update((items) => [...items]);
912
- }
913
- async handlerAdd() {
914
- let dataLanguage = {};
915
- const configHeader = this.configHeader();
916
- if (configHeader) {
917
- dataLanguage = cloneDeep(configHeader.dataDefault);
902
+ /**
903
+ * Mỗi dòng cần một bản `data` (shallow copy từng `IDataItem`) để multi-language con không dùng chung một mảng tham chiếu.
904
+ */
905
+ syncDataMultiKey(indexRemove) {
906
+ const templates = this.configItems();
907
+ const rowCount = this.dataMultiLanguage().length;
908
+ if (!templates?.length) {
909
+ this.dataMultiKey.set([]);
910
+ return;
911
+ }
912
+ if (this.dataMultiKey().length === rowCount) {
913
+ return;
914
+ }
915
+ if (this.dataMultiKey().length > rowCount && !isNil(indexRemove)) {
916
+ this.dataMultiKey.update((data) => {
917
+ data.splice(indexRemove, 1);
918
+ return data;
919
+ });
920
+ return;
918
921
  }
922
+ const newData = Array.from({ length: rowCount - this.dataMultiKey().length }, () => templates.map((c) => cloneDeep(c)));
923
+ this.dataMultiKey.update((data) => [...data, ...newData]);
924
+ }
925
+ handlerAdd() {
926
+ const header = this.configHeader();
927
+ const dataLanguage = header?.dataDefault ? cloneDeep(header.dataDefault) : {};
919
928
  this.dataMultiLanguage.update((items) => [...items, dataLanguage]);
920
- this.dataMultiKey.update((items) => [...items, this.configItems()]);
921
929
  this.handlerChangeValue();
922
930
  }
923
- async handlerRemove(index) {
924
- this.dataMultiLanguage.update((items) => {
925
- items.splice(index, 1);
926
- return [...items];
927
- });
931
+ handlerRemove(index) {
932
+ this.dataMultiLanguage.update((items) => items.filter((_, i) => i !== index));
933
+ this.syncDataMultiKey(index);
928
934
  this.handlerChangeValue();
929
935
  }
930
- async handlerClick(e) {
931
- e.stopPropagation();
932
- this.outClick.emit();
933
- }
934
- async handlerFunctionsControlInputLanguage(event) {
935
- this.multiLanguageFunctionControl.update((items) => [...items, event]);
936
- console.log(this.multiLanguageFunctionControl());
937
- }
938
- async handlerFunctionsControlInputValid(event) {
939
- this.inputValidFunctionControl.update((items) => [...items, event]);
940
- }
941
936
  async validate() {
942
937
  let valid = true;
943
- this.checkValidRequiredWhenInputHasValue();
944
- for (const control of this.inputValidFunctionControl()) {
945
- if (!(await control.checkIsValid())) {
938
+ this.applyValidRequiredWhenHeaderHasValue();
939
+ const rowCount = this.dataMultiLanguage().length;
940
+ for (let i = 0; i < rowCount; i++) {
941
+ const inputCtrl = this.inputComponentRefs()[i];
942
+ if (inputCtrl && !(await inputCtrl.FunctionsControl.checkIsValid())) {
946
943
  valid = false;
947
944
  }
948
- }
949
- for (const control of this.multiLanguageFunctionControl()) {
950
- if (!(await control.checkIsValid())) {
945
+ const mlCtrl = this.multiLanguageComponentRefs()[i];
946
+ if (mlCtrl && !(await mlCtrl.FunctionsControl.checkIsValid())) {
951
947
  valid = false;
952
948
  }
953
949
  }
954
950
  return valid;
955
951
  }
956
- async getData() {
957
- const dataMultiLanguage = [];
958
- for (const element of this.multiLanguageFunctionControl()) {
959
- dataMultiLanguage.push((await element.getData()) || {});
952
+ getData() {
953
+ const rowCount = this.dataMultiLanguage().length;
954
+ const out = [];
955
+ for (let i = 0; i < rowCount; i++) {
956
+ const ctrl = this.multiLanguageComponentRefs()[i];
957
+ out.push((ctrl?.FunctionsControl.getData() ?? {}));
960
958
  }
961
- // this.dataMultiLanguage.update(items => [...items]);
962
- return dataMultiLanguage;
959
+ return out;
963
960
  }
964
- async handlerChangeValue(value, type) {
961
+ handlerChangeValue(value, type) {
965
962
  if (type === 'input') {
966
963
  this.dataHeader.set(value);
967
964
  }
968
- this.checkValidRequiredWhenInputHasValue();
965
+ this.applyValidRequiredWhenHeaderHasValue();
969
966
  this.outChangeValue.emit();
970
967
  }
971
- async checkValidRequiredWhenInputHasValue() {
968
+ applyValidRequiredWhenHeaderHasValue() {
972
969
  this.validRequiredWhenInputHasValue.set(undefined);
973
970
  if (!isNil(this.dataHeader())) {
974
971
  this.validRequiredWhenInputHasValue.set({ isRequired: true });
975
972
  }
976
973
  }
977
974
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
978
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsInputsMultiLanguageItemsComponent, isStandalone: true, selector: "libs_ui-components-inputs-multi_language-items", inputs: { configItems: { classPropertyName: "configItems", publicName: "configItems", isSignal: true, isRequired: false, transformFunction: null }, dataMultiLanguage: { classPropertyName: "dataMultiLanguage", publicName: "dataMultiLanguage", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, ignoreAdd: { classPropertyName: "ignoreAdd", publicName: "ignoreAdd", isSignal: true, isRequired: false, transformFunction: null }, labelAddItem: { classPropertyName: "labelAddItem", publicName: "labelAddItem", isSignal: true, isRequired: false, transformFunction: null }, singleLanguage: { classPropertyName: "singleLanguage", publicName: "singleLanguage", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dataMultiLanguage: "dataMultiLanguageChange", outClick: "outClick", outFunctionControl: "outFunctionControl", outChangeValue: "outChangeValue" }, ngImport: i0, template: "<div class=\"mt-[4px]\">\n @for (item of dataMultiLanguage(); track item) {\n <div\n class=\"flex w-full\"\n [class.mt-[12px]]=\"!$first\">\n <div\n class=\"libs-ui-border-general\"\n [class.w-full]=\"dataMultiLanguage().length < 2\"\n [class.w-[calc(100%-28px)]]=\"dataMultiLanguage().length > 1\">\n @if (configHeader(); as configHeader) {\n <div class=\"flex bg-[#e6eef5] px-[12px] py-[4px]\">\n <div class=\"libs-ui-font-h6m h-[32px] flex items-center\">\n @let constHtmlTitle = configHeader.title ?? ' ';\n {{ constHtmlTitle | translate }}\n </div>\n <div\n (click)=\"handlerClick($event)\"\n class=\"pl-[8px]\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: item; as itemMap) {\n <libs_ui-components-inputs-valid\n [(item)]=\"itemMap\"\n [dataType]=\"configHeader.type && configHeader.type === 'number' ? 'int' : 'string'\"\n [fieldNameBind]=\"langDefault()\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"{ isRequired: configItems()[0].validRequired?.isRequired ?? false }\"\n [placeholder]=\"'i18n_enter_value'\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [fixedFloat]=\"15\"\n (outValueChange)=\"handlerChangeValue($event, 'input')\"\n (outFunctionsControl)=\"handlerFunctionsControlInputValid($event)\" />\n }\n </div>\n </div>\n <div class=\"px-[12px] pt-[8px] pb-[12px] flex w-full\">\n <libs_ui-components-inputs-multi_language\n class=\"w-full\"\n [singleLanguage]=\"singleLanguage() || false\"\n [multiLine]=\"false\"\n [titleField]=\"configItems()[0].titleField || ''\"\n [keyHeader]=\"configHeader.keyBindData ?? ''\"\n [placeholder]=\"'i18n_import_content'\"\n [classIncludeValue]=\"'libs-ui-font-h4r'\"\n [data]=\"dataMultiKey()[$index]\"\n [validRequired]=\"validRequiredWhenInputHasValue() || configItems()[0].validRequired\"\n [dataLanguage]=\"item\"\n [zIndex]=\"1203\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n [viewType]=\"configItems()[0].type ? (configItems()[0].type === 'number' ? 'number' : configItems()[0].type === 'float' ? 'float' : 'text') : 'text'\"\n (outEventMultiLanguage)=\"handlerChangeValue()\"\n (outChangeValueInput)=\"handlerChangeValue()\"\n (outFunctionsControl)=\"handlerFunctionsControlInputLanguage($event)\" />\n </div>\n }\n </div>\n @if (!$first) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0 ml-[8px] mt-[12px]'\"\n (outClick)=\"handlerRemove($index)\" />\n }\n </div>\n }\n @if (!ignoreAdd()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add mr-[8px]'\"\n [classLabel]=\"'libs-ui-font-h5r'\"\n [classInclude]=\"'!px-0 mt-[8px]'\"\n [label]=\"labelAddItem() || ''\"\n (outClick)=\"handlerAdd()\" />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetItemPipe, name: "LibsUiComponentsInputsMultiLanguageGetItemPipe" }, { kind: "component", type: LibsUiComponentsInputsValidComponent, selector: "libs_ui-components-inputs-valid", inputs: ["item", "labelConfig", "emitEmptyInDataTypeNumber", "ignoreBlockInputMaxValue", "fieldNameBind", "showCount", "typeComponentSelectItem", "valueComponentSelectItem", "disableComponentSelectItem", "tagInput", "dataType", "typeInput", "modeInput", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "ignoreShowMessageError", "borderError", "iconLeftClass", "popoverContentIconLeft", "iconRightClass", "popoverContentIconRight", "zIndexPopoverContent", "unitsLeft", "configUnitLeft", "keySelectedUnitLeft", "unitsRight", "configUnitRight", "keySelectedUnitRight", "maxValueNumber", "minValueNumber", "ignoreContentLeft", "ignoreContentRight", "isBaselineStyle", "valuePatternShowError", "validPattern", "validRequired", "validMinLength", "validMinValue", "validMaxValue", "validMaxLength", "functionValid", "maxLength", "positionMessageErrorStartInput", "classInclude", "resize", "templateLeftBottomInput", "templateRightBottomInput", "onlyAcceptNegativeValue", "autoAddZeroLessThan10InTypeInt", "maxLengthNumberCount", "classMessageErrorInclude", "ignoreStopPropagationEvent", "ignoreUnitRightClassReadOnly", "paddingRightCustomSpecific", "focusTimeOut", "debounceTimeValidate"], outputs: ["itemChange", "outValueChange", "outSelect", "outIconLeft", "outIconRight", "outClickButtonLabel", "outSwitchEventLabel", "outLabelRightClick", "outEnterInputEvent", "outHeightAreaChange", "outFunctionsControl", "outFocusAndBlur", "outChangeValueByButtonUpDown"] }, { kind: "component", type: LibsUiComponentsInputsMultiLanguageComponent, selector: "libs_ui-components-inputs-multi_language", inputs: ["optionsLanguage", "zIndex", "viewType", "singleLanguage", "data", "validRequired", "ignoreAdd", "titleField", "keyHeader", "textArea", "placeholder", "extendClass", "extendClassContent", "viewPosition", "ignoreRemove", "validMaxLength", "validMinLength", "countCharacters", "viewContent", "classIncludeKey", "classIncludeValue", "dataLanguage", "multiLine", "readonly", "acceptNegativeValue", "valueUpDownNumber", "maxValueNumber", "onlyAcceptNegativeValue", "validOneDefaultMultiLanguage"], outputs: ["dataChange", "ignoreAddChange", "extendClassChange", "dataLanguageChange", "outEventMultiLanguage", "outChangeTypeLanguage", "outFunctionsControl", "outChangeValueInput"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
975
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsInputsMultiLanguageItemsComponent, isStandalone: true, selector: "libs_ui-components-inputs-multi_language-items", inputs: { configItems: { classPropertyName: "configItems", publicName: "configItems", isSignal: true, isRequired: false, transformFunction: null }, dataMultiLanguage: { classPropertyName: "dataMultiLanguage", publicName: "dataMultiLanguage", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, ignoreAdd: { classPropertyName: "ignoreAdd", publicName: "ignoreAdd", isSignal: true, isRequired: false, transformFunction: null }, labelAddItem: { classPropertyName: "labelAddItem", publicName: "labelAddItem", isSignal: true, isRequired: false, transformFunction: null }, singleLanguage: { classPropertyName: "singleLanguage", publicName: "singleLanguage", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, classIconAddLanguage: { classPropertyName: "classIconAddLanguage", publicName: "classIconAddLanguage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dataMultiLanguage: "dataMultiLanguageChange", outChangeValue: "outChangeValue" }, viewQueries: [{ propertyName: "inputComponentRefs", predicate: LibsUiComponentsInputsValidComponent, descendants: true, isSignal: true }, { propertyName: "multiLanguageComponentRefs", predicate: LibsUiComponentsInputsMultiLanguageComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-[8px]\">\n @for (item of dataMultiLanguage(); track item) {\n <div class=\"libs-ui-border-general w-full rounded-[4px]\">\n @if (configHeader(); as configHeader) {\n <div class=\"flex bg-[var(--libs-ui-color-light-2)] p-[12px] gap-[16px]\">\n <div class=\"flex gap-[8px] w-full\">\n <div class=\"libs-ui-font-h6m h-[32px] flex items-center shrink-0\">\n @let constHtmlTitle = configHeader.title ?? ' ';\n {{ constHtmlTitle | translate }}\n </div>\n <div class=\"w-full\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: item; as itemMap) {\n <libs_ui-components-inputs-valid\n [(item)]=\"itemMap\"\n [dataType]=\"configHeader.type && configHeader.type === 'number' ? 'int' : 'string'\"\n [fieldNameBind]=\"langDefault()\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"{ isRequired: configItems()[0].validRequired?.isRequired ?? false }\"\n [placeholder]=\"'i18n_enter_value'\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [fixedFloat]=\"15\"\n (outValueChange)=\"handlerChangeValue($event, 'input')\" />\n }\n </div>\n </div>\n @if (!$first) {\n <div class=\"flex items-center h-[32px]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemove($index)\" />\n </div>\n }\n </div>\n <div class=\"p-[12px] flex w-full\">\n <libs_ui-components-inputs-multi_language\n class=\"w-full\"\n [singleLanguage]=\"singleLanguage()\"\n [titleField]=\"configItems()[0].titleField || ''\"\n [keyHeader]=\"configHeader.keyBindData ?? ''\"\n [placeholder]=\"'i18n_import_content'\"\n [classIncludeValue]=\"'libs-ui-font-h5r'\"\n [data]=\"dataMultiKey()[$index]\"\n [validRequired]=\"validRequiredWhenInputHasValue() || configItems()[0].validRequired\"\n [dataLanguage]=\"item\"\n [zIndex]=\"zIndex() ?? 1203\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n [classIconAddLanguage]=\"classIconAddLanguage()\"\n [viewType]=\"configItems()[0].type ? (configItems()[0].type === 'number' ? 'number' : configItems()[0].type === 'float' ? 'float' : 'text') : 'text'\"\n (outEventMultiLanguage)=\"handlerChangeValue()\"\n (outChangeValueInput)=\"handlerChangeValue()\" />\n </div>\n }\n </div>\n }\n @if (!ignoreAdd()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classLabel]=\"'libs-ui-font-h6mi'\"\n [classInclude]=\"'!px-0 !py-[2px]'\"\n [label]=\"labelAddItem() || ''\"\n (outClick)=\"handlerAdd()\" />\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: LibsUiComponentsInputsMultiLanguageGetItemPipe, name: "LibsUiComponentsInputsMultiLanguageGetItemPipe" }, { kind: "component", type: LibsUiComponentsInputsValidComponent, selector: "libs_ui-components-inputs-valid", inputs: ["item", "labelConfig", "emitEmptyInDataTypeNumber", "ignoreBlockInputMaxValue", "fieldNameBind", "showCount", "typeComponentSelectItem", "valueComponentSelectItem", "disableComponentSelectItem", "tagInput", "dataType", "typeInput", "modeInput", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "ignoreShowMessageError", "borderError", "iconLeftClass", "popoverContentIconLeft", "iconRightClass", "popoverContentIconRight", "zIndexPopoverContent", "unitsLeft", "configUnitLeft", "keySelectedUnitLeft", "unitsRight", "configUnitRight", "keySelectedUnitRight", "maxValueNumber", "minValueNumber", "ignoreContentLeft", "ignoreContentRight", "isBaselineStyle", "valuePatternShowError", "validPattern", "validRequired", "validMinLength", "validMinValue", "validMaxValue", "validMaxLength", "functionValid", "maxLength", "positionMessageErrorStartInput", "classInclude", "resize", "templateLeftBottomInput", "templateRightBottomInput", "onlyAcceptNegativeValue", "autoAddZeroLessThan10InTypeInt", "maxLengthNumberCount", "classMessageErrorInclude", "ignoreStopPropagationEvent", "ignoreUnitRightClassReadOnly", "paddingRightCustomSpecific", "focusTimeOut", "debounceTimeValidate"], outputs: ["itemChange", "outValueChange", "outSelect", "outIconLeft", "outIconRight", "outClickButtonLabel", "outSwitchEventLabel", "outLabelRightClick", "outEnterInputEvent", "outHeightAreaChange", "outFunctionsControl", "outFocusAndBlur", "outChangeValueByButtonUpDown"] }, { kind: "component", type: LibsUiComponentsInputsMultiLanguageComponent, selector: "libs_ui-components-inputs-multi_language", inputs: ["optionsLanguage", "zIndex", "viewType", "singleLanguage", "data", "validRequired", "ignoreAdd", "titleField", "keyHeader", "textArea", "placeholder", "extendClass", "extendClassContent", "viewPosition", "ignoreRemove", "validMaxLength", "validMinLength", "countCharacters", "viewContent", "classIncludeKey", "classIncludeValue", "dataLanguage", "readonly", "acceptNegativeValue", "valueUpDownNumber", "maxValueNumber", "onlyAcceptNegativeValue", "validOneDefaultMultiLanguage", "classIconAddLanguage", "validPattern"], outputs: ["dataChange", "ignoreAddChange", "extendClassChange", "dataLanguageChange", "outEventMultiLanguage", "outChangeTypeLanguage", "outChangeValueInput"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
979
976
  }
980
977
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageItemsComponent, decorators: [{
981
978
  type: Component,
982
- args: [{ selector: 'libs_ui-components-inputs-multi_language-items', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsInputsMultiLanguageGetItemPipe, LibsUiComponentsInputsValidComponent, LibsUiComponentsInputsMultiLanguageComponent, LibsUiComponentsButtonsButtonComponent], template: "<div class=\"mt-[4px]\">\n @for (item of dataMultiLanguage(); track item) {\n <div\n class=\"flex w-full\"\n [class.mt-[12px]]=\"!$first\">\n <div\n class=\"libs-ui-border-general\"\n [class.w-full]=\"dataMultiLanguage().length < 2\"\n [class.w-[calc(100%-28px)]]=\"dataMultiLanguage().length > 1\">\n @if (configHeader(); as configHeader) {\n <div class=\"flex bg-[#e6eef5] px-[12px] py-[4px]\">\n <div class=\"libs-ui-font-h6m h-[32px] flex items-center\">\n @let constHtmlTitle = configHeader.title ?? ' ';\n {{ constHtmlTitle | translate }}\n </div>\n <div\n (click)=\"handlerClick($event)\"\n class=\"pl-[8px]\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: item; as itemMap) {\n <libs_ui-components-inputs-valid\n [(item)]=\"itemMap\"\n [dataType]=\"configHeader.type && configHeader.type === 'number' ? 'int' : 'string'\"\n [fieldNameBind]=\"langDefault()\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"{ isRequired: configItems()[0].validRequired?.isRequired ?? false }\"\n [placeholder]=\"'i18n_enter_value'\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [fixedFloat]=\"15\"\n (outValueChange)=\"handlerChangeValue($event, 'input')\"\n (outFunctionsControl)=\"handlerFunctionsControlInputValid($event)\" />\n }\n </div>\n </div>\n <div class=\"px-[12px] pt-[8px] pb-[12px] flex w-full\">\n <libs_ui-components-inputs-multi_language\n class=\"w-full\"\n [singleLanguage]=\"singleLanguage() || false\"\n [multiLine]=\"false\"\n [titleField]=\"configItems()[0].titleField || ''\"\n [keyHeader]=\"configHeader.keyBindData ?? ''\"\n [placeholder]=\"'i18n_import_content'\"\n [classIncludeValue]=\"'libs-ui-font-h4r'\"\n [data]=\"dataMultiKey()[$index]\"\n [validRequired]=\"validRequiredWhenInputHasValue() || configItems()[0].validRequired\"\n [dataLanguage]=\"item\"\n [zIndex]=\"1203\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n [viewType]=\"configItems()[0].type ? (configItems()[0].type === 'number' ? 'number' : configItems()[0].type === 'float' ? 'float' : 'text') : 'text'\"\n (outEventMultiLanguage)=\"handlerChangeValue()\"\n (outChangeValueInput)=\"handlerChangeValue()\"\n (outFunctionsControl)=\"handlerFunctionsControlInputLanguage($event)\" />\n </div>\n }\n </div>\n @if (!$first) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0 ml-[8px] mt-[12px]'\"\n (outClick)=\"handlerRemove($index)\" />\n }\n </div>\n }\n @if (!ignoreAdd()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add mr-[8px]'\"\n [classLabel]=\"'libs-ui-font-h5r'\"\n [classInclude]=\"'!px-0 mt-[8px]'\"\n [label]=\"labelAddItem() || ''\"\n (outClick)=\"handlerAdd()\" />\n }\n</div>\n" }]
979
+ args: [{ selector: 'libs_ui-components-inputs-multi_language-items', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsInputsMultiLanguageGetItemPipe, LibsUiComponentsInputsValidComponent, LibsUiComponentsInputsMultiLanguageComponent, LibsUiComponentsButtonsButtonComponent], template: "<div class=\"flex flex-col gap-[8px]\">\n @for (item of dataMultiLanguage(); track item) {\n <div class=\"libs-ui-border-general w-full rounded-[4px]\">\n @if (configHeader(); as configHeader) {\n <div class=\"flex bg-[var(--libs-ui-color-light-2)] p-[12px] gap-[16px]\">\n <div class=\"flex gap-[8px] w-full\">\n <div class=\"libs-ui-font-h6m h-[32px] flex items-center shrink-0\">\n @let constHtmlTitle = configHeader.title ?? ' ';\n {{ constHtmlTitle | translate }}\n </div>\n <div class=\"w-full\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe: item; as itemMap) {\n <libs_ui-components-inputs-valid\n [(item)]=\"itemMap\"\n [dataType]=\"configHeader.type && configHeader.type === 'number' ? 'int' : 'string'\"\n [fieldNameBind]=\"langDefault()\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"{ isRequired: configItems()[0].validRequired?.isRequired ?? false }\"\n [placeholder]=\"'i18n_enter_value'\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [fixedFloat]=\"15\"\n (outValueChange)=\"handlerChangeValue($event, 'input')\" />\n }\n </div>\n </div>\n @if (!$first) {\n <div class=\"flex items-center h-[32px]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-custom'\"\n [buttonCustom]=\"{\n configStepColor: {\n text: '#071631',\n text_hover: '#ee2d41',\n text_active: '#ee2d41',\n text_disable: '071631',\n },\n rootColor: '#071631',\n }\"\n [iconOnlyType]=\"true\"\n [popover]=\"{ config: { content: 'i18n_delete', zIndex: 1205 } }\"\n [classIconLeft]=\"'libs-ui-icon-remove'\"\n [classInclude]=\"'!p-0'\"\n (outClick)=\"handlerRemove($index)\" />\n </div>\n }\n </div>\n <div class=\"p-[12px] flex w-full\">\n <libs_ui-components-inputs-multi_language\n class=\"w-full\"\n [singleLanguage]=\"singleLanguage()\"\n [titleField]=\"configItems()[0].titleField || ''\"\n [keyHeader]=\"configHeader.keyBindData ?? ''\"\n [placeholder]=\"'i18n_import_content'\"\n [classIncludeValue]=\"'libs-ui-font-h5r'\"\n [data]=\"dataMultiKey()[$index]\"\n [validRequired]=\"validRequiredWhenInputHasValue() || configItems()[0].validRequired\"\n [dataLanguage]=\"item\"\n [zIndex]=\"zIndex() ?? 1203\"\n [acceptNegativeValue]=\"acceptNegativeValue() ?? true\"\n [valueUpDownNumber]=\"valueUpDownNumber() || 1\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n [classIconAddLanguage]=\"classIconAddLanguage()\"\n [viewType]=\"configItems()[0].type ? (configItems()[0].type === 'number' ? 'number' : configItems()[0].type === 'float' ? 'float' : 'text') : 'text'\"\n (outEventMultiLanguage)=\"handlerChangeValue()\"\n (outChangeValueInput)=\"handlerChangeValue()\" />\n </div>\n }\n </div>\n }\n @if (!ignoreAdd()) {\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classIconLeft]=\"'libs-ui-icon-add'\"\n [classLabel]=\"'libs-ui-font-h6mi'\"\n [classInclude]=\"'!px-0 !py-[2px]'\"\n [label]=\"labelAddItem() || ''\"\n (outClick)=\"handlerAdd()\" />\n }\n</div>\n" }]
983
980
  }], ctorParameters: () => [] });
984
981
 
985
982
  /**