@libs-ui/components-inputs-multi-language 0.2.356-22 → 0.2.356-24

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.
@@ -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());
@@ -488,9 +487,8 @@ class LibsUiComponentsInputsMultiLanguageComponent {
488
487
  listConfigItem = computed(() => listConfigItem(this.options()));
489
488
  httpRequestDetail = computed(() => httpRequestDetail(this.options()));
490
489
  inputFunctionControl = signal(new Map());
491
- quillFunctionControl = signal([]);
490
+ quillFunctionControl = signal(new Map());
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,14 +511,13 @@ 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' });
524
521
  outEventMultiLanguage = output();
525
522
  outChangeTypeLanguage = output();
526
523
  outFunctionsControl = output();
@@ -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,18 +565,18 @@ 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
  });
@@ -605,82 +591,109 @@ class LibsUiComponentsInputsMultiLanguageComponent {
605
591
  getData: this.getData.bind(this),
606
592
  };
607
593
  }
608
- async handlerInputFunctionControl(event, key) {
609
- this.inputFunctionControl().set(key, event);
594
+ /** Các key ngôn ngữ / tiền tệ cần hiển thị theo dữ liệu + cấu hình options. */
595
+ computeLanguageDisplayKeys() {
596
+ const dc = this.dataLanguageChange();
597
+ const opts = this.options();
598
+ const langs = this.langDefault();
599
+ const selected = new Set();
600
+ for (const k of Object.keys(dc)) {
601
+ if (opts.some((o) => o.key === k)) {
602
+ selected.add(k);
603
+ }
604
+ }
605
+ for (const k of langs) {
606
+ if (!isNil(get(dc, k))) {
607
+ selected.add(k);
608
+ }
609
+ }
610
+ return Array.from(selected);
611
+ }
612
+ handlerInputFunctionControl(event, key) {
613
+ this.inputFunctionControl.update((map) => {
614
+ const next = new Map(map);
615
+ next.set(key, event);
616
+ return next;
617
+ });
610
618
  }
611
- async handlerQuillFunctionControl(event) {
612
- this.quillFunctionControl.update((items) => [...items, event]);
619
+ handlerQuillFunctionControl(event, index) {
620
+ this.quillFunctionControl.update((map) => {
621
+ const next = new Map(map);
622
+ next.set(index, event);
623
+ return next;
624
+ });
613
625
  }
614
- async handlerSelectChange(event, keyOld) {
626
+ handlerSelectChange(event, keyOld) {
615
627
  if (!event || event.key === keyOld) {
616
628
  return;
617
629
  }
618
630
  this.languageDisplay.update((value) => value.map((item) => (item === keyOld ? event.key : item)));
619
631
  delete this.dataLanguageChange()[keyOld];
620
632
  delete this.dataLanguage()[keyOld];
621
- this.setDefaultData(event.key);
633
+ void this.setDefaultData(event.key);
622
634
  }
623
- async handlerAddLanguage(event) {
635
+ handlerAddLanguage(event) {
624
636
  event.stopPropagation();
625
637
  const lang = this.options().find((item) => !this.languageDisplay().includes(item.key));
626
638
  if (!lang) {
627
639
  return;
628
640
  }
629
641
  this.languageDisplay.update((value) => [...value, lang.key]);
630
- this.setDefaultData(lang.key);
642
+ void this.setDefaultData(lang.key);
631
643
  if (this.options().length === this.languageDisplay().length) {
632
644
  this.ignoreAdd.set(true);
633
645
  }
634
646
  this.outEventMultiLanguage.emit({ action: 'add', data: this.dataLanguageChange() });
635
647
  }
636
- async handlerRemoveLanguage(event, key) {
648
+ handlerRemoveLanguage(event, key) {
637
649
  event.stopPropagation();
638
- this.ignoreAdd.set(true);
650
+ this.ignoreAdd.set(false);
639
651
  this.dataLanguageChange.update((value) => {
640
652
  delete value[key];
641
653
  return { ...value };
642
654
  });
643
- this.validateIsMultiKey();
655
+ void this.validateIsMultiKey();
644
656
  this.languageDisplay.update((value) => value.filter((item) => item !== key));
645
657
  this.outEventMultiLanguage.emit({ action: 'remove', data: this.dataLanguageChange() });
646
658
  this.inputFunctionControl().delete(key);
647
659
  }
648
- async getData() {
660
+ getData() {
649
661
  if (this.singleLanguage()) {
650
662
  const key = this.langDefault()[0];
651
- this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange, key) }));
663
+ this.dataLanguage.update((value) => ({ ...value, [key]: get(this.dataLanguageChange(), key) }));
652
664
  return this.dataLanguage();
653
665
  }
654
666
  if (this.data().length > 1) {
667
+ const defaultLang = this.langDefault()[0];
655
668
  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)) {
669
+ const keyBind = item.keyBindData;
670
+ const dataByKey = keyBind ? get(this.dataLanguageChange(), keyBind) : undefined;
671
+ if (keyBind && dataByKey && defaultLang && !get(dataByKey, defaultLang) && !get(this.dataLanguageChange(), defaultLang)) {
660
672
  return {};
661
673
  }
662
674
  }
663
675
  }
664
676
  return this.dataLanguageChange();
665
677
  }
666
- async generateData() {
678
+ generateData() {
667
679
  const lang = this.langDefault()[0];
668
- if (this.data().length) {
669
- this.data().forEach((item, index) => {
680
+ const dataItems = this.data();
681
+ if (dataItems.length) {
682
+ dataItems.forEach((item, index) => {
670
683
  const key = item.keyBindData;
671
- if (!index && isNil(get(this.dataLanguageChange, lang))) {
672
- this.setDefaultData(lang);
684
+ if (!index && isNil(get(this.dataLanguageChange(), lang))) {
685
+ void this.setDefaultData(lang);
673
686
  return;
674
687
  }
675
- if (!key || !isNil(get(this.dataLanguageChange, key))) {
688
+ if (!key || !isNil(get(this.dataLanguageChange(), key))) {
676
689
  return;
677
690
  }
678
691
  this.dataLanguageChange.update((value) => ({ ...value, [key]: { [lang]: '' } }));
679
692
  });
680
693
  }
681
- if (!this.data().length) {
694
+ if (!dataItems.length) {
682
695
  if (!this.dataLanguage() || !Object.keys(this.dataLanguage()).length) {
683
- this.setDefaultData(lang);
696
+ void this.setDefaultData(lang);
684
697
  }
685
698
  this.data.set([
686
699
  {
@@ -692,7 +705,7 @@ class LibsUiComponentsInputsMultiLanguageComponent {
692
705
  ]);
693
706
  }
694
707
  }
695
- async setDefaultData(key) {
708
+ setDefaultData(key) {
696
709
  this.dataLanguageChange.update((value) => ({ ...value, [key]: '' }));
697
710
  this.dataLanguage.update((value) => ({ ...value, [key]: '' }));
698
711
  }
@@ -703,7 +716,7 @@ class LibsUiComponentsInputsMultiLanguageComponent {
703
716
  valid = false;
704
717
  }
705
718
  }
706
- for (const control of this.quillFunctionControl()) {
719
+ for (const control of this.quillFunctionControl().values()) {
707
720
  if (!(await control.checkIsValid())) {
708
721
  valid = false;
709
722
  }
@@ -712,9 +725,12 @@ class LibsUiComponentsInputsMultiLanguageComponent {
712
725
  return valid;
713
726
  }
714
727
  if (this.data().length === 1) {
715
- await this.validateDefault();
728
+ const defaultOk = await this.validateDefault();
729
+ if (!defaultOk) {
730
+ valid = false;
731
+ }
716
732
  }
717
- this.validateIsMultiKey();
733
+ await this.validateIsMultiKey();
718
734
  return valid;
719
735
  }
720
736
  async validateDefault() {
@@ -734,12 +750,12 @@ class LibsUiComponentsInputsMultiLanguageComponent {
734
750
  return valid;
735
751
  }
736
752
  for (const key of Object.keys(this.dataLanguageChange())) {
737
- if (key !== 'id' && key !== this.keyHeader() && get(this.dataLanguageChange, key) && key !== this.langDefault()[0]) {
753
+ if (key !== 'id' && key !== this.keyHeader() && get(this.dataLanguageChange(), key) && key !== this.langDefault()[0]) {
738
754
  this.validRequiredDefault.update((value) => ({ ...value, isRequired: true }));
739
755
  if (!(await this.checkValidInput())) {
740
756
  valid = false;
741
757
  }
742
- return;
758
+ return valid;
743
759
  }
744
760
  this.validRequiredDefault.update((value) => ({ ...value, isRequired: false }));
745
761
  if (!(await this.checkValidInput())) {
@@ -757,73 +773,83 @@ class LibsUiComponentsInputsMultiLanguageComponent {
757
773
  }
758
774
  return valid;
759
775
  }
776
+ /**
777
+ * Khi có nhiều `IDataItem` (nhiều field bind), cập nhật `validRequiredLangDefault` theo dữ liệu đã nhập.
778
+ * 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.
779
+ */
760
780
  async validateIsMultiKey() {
761
- if (this.data().length > 1) {
762
- if (this.data()[0].validRequired?.isRequired) {
763
- return;
781
+ if (this.data().length <= 1) {
782
+ return;
783
+ }
784
+ if (this.data()[0].validRequired?.isRequired) {
785
+ return;
786
+ }
787
+ const dataItems = this.data();
788
+ const dc = this.dataLanguageChange();
789
+ for (const item of dataItems) {
790
+ if (!item.keyBindData) {
791
+ continue;
764
792
  }
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;
793
+ const nested = get(dc, item.keyBindData);
794
+ if (!nested || typeof nested !== 'object') {
795
+ continue;
796
+ }
797
+ langKey: for (const langNestedKey of Object.keys(nested)) {
798
+ for (const topKey of Object.keys(dc)) {
799
+ if (topKey === item.keyBindData || topKey === langNestedKey) {
800
+ continue;
801
+ }
802
+ if (get(dc, topKey) && this.options().find((opt) => opt.key === topKey)) {
803
+ for (const config of dataItems) {
804
+ if (config?.validRequiredLangDefault) {
805
+ config.validRequiredLangDefault.isRequired = true;
786
806
  await this.checkValidInput();
787
807
  }
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
808
  }
801
- return;
809
+ continue langKey;
802
810
  }
803
- if (!get(dataLanguageChangeByKeyBindData, keyBind)) {
804
- const dataSecond = this.data()[1];
805
- if (dataSecond && dataSecond.validRequiredLangDefault) {
806
- dataSecond.validRequiredLangDefault.isRequired = true;
811
+ for (const config of dataItems) {
812
+ if (config?.validRequiredLangDefault) {
813
+ config.validRequiredLangDefault.isRequired = false;
807
814
  await this.checkValidInput();
808
815
  }
809
- return;
810
816
  }
811
- });
812
- });
817
+ }
818
+ const dataLanguageChangeByKeyBind = get(dc, langNestedKey);
819
+ const dataByItemKey = item.keyBindData ? get(dc, item.keyBindData) : undefined;
820
+ if ((!dataLanguageChangeByKeyBind && !get(dataByItemKey, langNestedKey)) || (dataLanguageChangeByKeyBind && get(dataByItemKey, langNestedKey))) {
821
+ continue;
822
+ }
823
+ if (!dataLanguageChangeByKeyBind) {
824
+ const dataFirst = dataItems[0];
825
+ if (dataFirst?.validRequiredLangDefault) {
826
+ dataFirst.validRequiredLangDefault.isRequired = true;
827
+ await this.checkValidInput();
828
+ }
829
+ continue;
830
+ }
831
+ if (!get(dataByItemKey, langNestedKey)) {
832
+ const dataSecond = dataItems[1];
833
+ if (dataSecond?.validRequiredLangDefault) {
834
+ dataSecond.validRequiredLangDefault.isRequired = true;
835
+ await this.checkValidInput();
836
+ }
837
+ }
838
+ }
813
839
  }
814
840
  }
815
- async handlerInputChange() {
841
+ handlerInputChange() {
816
842
  this.outChangeValueInput.emit();
817
843
  timer(500)
818
844
  .pipe(takeUntil(this.onDestroy))
819
- .subscribe(() => this.validate());
845
+ .subscribe(() => void this.validate());
820
846
  }
821
847
  ngOnDestroy() {
822
848
  this.onDestroy.next();
823
849
  this.onDestroy.complete();
824
850
  }
825
851
  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 });
852
+ 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 } }, outputs: { data: "dataChange", ignoreAdd: "ignoreAddChange", extendClass: "extendClassChange", dataLanguage: "dataLanguageChange", outEventMultiLanguage: "outEventMultiLanguage", outChangeTypeLanguage: "outChangeTypeLanguage", outFunctionsControl: "outFunctionsControl", outChangeValueInput: "outChangeValueInput" }, 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; let itemIndex = $index) {\n @if (item.type === 'editor') {\n <div class=\"w-full min-w-0 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, itemIndex)\" />\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 [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerInputFunctionControl($event, key)\" />\n }\n </div>\n }\n }\n @if (!singleLanguage()) {\n <div\n class=\"flex items-center w-[16px]\"\n [class.h-[32px]]=\"data()[0].type !== 'editor'\"\n [class.h-[40px]]=\"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: 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 });
827
853
  }
828
854
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageComponent, decorators: [{
829
855
  type: Component,
@@ -838,19 +864,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
838
864
  LibsUiComponentsInputsMultiLanguageGetItemPipe,
839
865
  LibsUiPipesEscapeHtmlPipe,
840
866
  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" }]
867
+ ], 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; let itemIndex = $index) {\n @if (item.type === 'editor') {\n <div class=\"w-full min-w-0 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, itemIndex)\" />\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 [acceptNegativeValue]=\"acceptNegativeValue()\"\n [valueUpDownNumber]=\"valueUpDownNumber()\"\n [maxValueNumber]=\"maxValueNumber()\"\n [onlyAcceptNegativeValue]=\"onlyAcceptNegativeValue()\"\n (outValueChange)=\"handlerInputChange()\"\n (outFunctionsControl)=\"handlerInputFunctionControl($event, key)\" />\n }\n </div>\n }\n }\n @if (!singleLanguage()) {\n <div\n class=\"flex items-center w-[16px]\"\n [class.h-[32px]]=\"data()[0].type !== 'editor'\"\n [class.h-[40px]]=\"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
868
  }], ctorParameters: () => [] });
843
869
 
844
870
  class LibsUiComponentsInputsMultiLanguageItemsComponent {
845
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
846
871
  dataMultiKey = signal([]);
847
872
  langDefault = signal(UtilsCache.getLang());
848
873
  configHeader = signal(undefined);
849
874
  validRequired = signal({ isRequired: false });
850
875
  validRequiredWhenInputHasValue = signal(undefined);
851
876
  dataHeader = signal(undefined);
852
- multiLanguageFunctionControl = signal([]);
853
- inputValidFunctionControl = signal([]);
877
+ /** Một control valid header cho mỗi dòng (theo index). */
878
+ inputValidByRow = signal(new Map());
879
+ /** Một control multi-language cho mỗi dòng (theo index). */
880
+ multiLanguageByRow = signal(new Map());
854
881
  configItems = input([]);
855
882
  dataMultiLanguage = model([{}]);
856
883
  zIndex = input();
@@ -861,38 +888,33 @@ class LibsUiComponentsInputsMultiLanguageItemsComponent {
861
888
  valueUpDownNumber = input();
862
889
  maxValueNumber = input();
863
890
  onlyAcceptNegativeValue = input();
891
+ classIconAddLanguage = input('libs-ui-icon-add', { transform: (value) => value || 'libs-ui-icon-add' });
864
892
  outClick = output();
865
893
  outFunctionControl = output();
866
894
  outChangeValue = output();
867
895
  constructor() {
868
896
  effect(() => {
869
- const configItems = this.configItems();
897
+ const items = this.configItems();
870
898
  untracked(() => {
871
- if (configItems && configItems.length) {
872
- this.configHeader.set(configItems[0].header);
873
- }
899
+ this.configHeader.set(items?.[0]?.header);
900
+ this.validRequired.set(items?.[0]?.validRequired ?? { isRequired: false });
901
+ this.syncDataMultiKey();
874
902
  });
875
903
  });
876
904
  effect(() => {
877
- const dataMultiLanguage = this.dataMultiLanguage();
905
+ const rows = this.dataMultiLanguage();
878
906
  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
- }
907
+ if (!rows?.length) {
908
+ const header = this.configHeader();
909
+ const initial = header?.dataDefault ? cloneDeep(header.dataDefault) : {};
910
+ this.dataMultiLanguage.set([initial]);
885
911
  }
886
- this.handlerConfigMulti();
912
+ this.syncDataMultiKey();
887
913
  });
888
914
  });
889
915
  }
890
916
  ngOnInit() {
891
917
  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
918
  }
897
919
  get FunctionsControl() {
898
920
  return {
@@ -900,86 +922,101 @@ class LibsUiComponentsInputsMultiLanguageItemsComponent {
900
922
  getData: this.getData.bind(this),
901
923
  };
902
924
  }
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);
925
+ /**
926
+ * 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.
927
+ */
928
+ syncDataMultiKey() {
929
+ const templates = this.configItems();
930
+ const rowCount = this.dataMultiLanguage().length;
931
+ if (!templates?.length) {
932
+ this.dataMultiKey.set([]);
933
+ return;
918
934
  }
935
+ this.dataMultiKey.set(Array.from({ length: rowCount }, () => templates.map((c) => ({ ...c }))));
936
+ }
937
+ handlerAdd() {
938
+ const header = this.configHeader();
939
+ const dataLanguage = header?.dataDefault ? cloneDeep(header.dataDefault) : {};
919
940
  this.dataMultiLanguage.update((items) => [...items, dataLanguage]);
920
- this.dataMultiKey.update((items) => [...items, this.configItems()]);
941
+ this.syncDataMultiKey();
921
942
  this.handlerChangeValue();
922
943
  }
923
- async handlerRemove(index) {
924
- this.dataMultiLanguage.update((items) => {
925
- items.splice(index, 1);
926
- return [...items];
927
- });
944
+ handlerRemove(index) {
945
+ this.dataMultiLanguage.update((items) => items.filter((_, i) => i !== index));
946
+ this.reindexRowMapsAfterRemove(index);
947
+ this.syncDataMultiKey();
928
948
  this.handlerChangeValue();
929
949
  }
930
- async handlerClick(e) {
950
+ reindexRowMapsAfterRemove(removedIndex) {
951
+ const reindex = (m) => {
952
+ const next = new Map();
953
+ m.forEach((v, k) => {
954
+ if (k < removedIndex) {
955
+ next.set(k, v);
956
+ }
957
+ else if (k > removedIndex) {
958
+ next.set(k - 1, v);
959
+ }
960
+ });
961
+ return next;
962
+ };
963
+ this.inputValidByRow.update((m) => reindex(m));
964
+ this.multiLanguageByRow.update((m) => reindex(m));
965
+ }
966
+ handlerClick(e) {
931
967
  e.stopPropagation();
932
968
  this.outClick.emit();
933
969
  }
934
- async handlerFunctionsControlInputLanguage(event) {
935
- this.multiLanguageFunctionControl.update((items) => [...items, event]);
936
- console.log(this.multiLanguageFunctionControl());
970
+ handlerFunctionsControlInputLanguage(event, rowIndex) {
971
+ this.multiLanguageByRow.update((m) => new Map(m).set(rowIndex, event));
937
972
  }
938
- async handlerFunctionsControlInputValid(event) {
939
- this.inputValidFunctionControl.update((items) => [...items, event]);
973
+ handlerFunctionsControlInputValid(event, rowIndex) {
974
+ this.inputValidByRow.update((m) => new Map(m).set(rowIndex, event));
940
975
  }
941
976
  async validate() {
942
977
  let valid = true;
943
- this.checkValidRequiredWhenInputHasValue();
944
- for (const control of this.inputValidFunctionControl()) {
945
- if (!(await control.checkIsValid())) {
978
+ this.applyValidRequiredWhenHeaderHasValue();
979
+ const rowCount = this.dataMultiLanguage().length;
980
+ for (let i = 0; i < rowCount; i++) {
981
+ const inputCtrl = this.inputValidByRow().get(i);
982
+ if (inputCtrl && !(await inputCtrl.checkIsValid())) {
946
983
  valid = false;
947
984
  }
948
- }
949
- for (const control of this.multiLanguageFunctionControl()) {
950
- if (!(await control.checkIsValid())) {
985
+ const mlCtrl = this.multiLanguageByRow().get(i);
986
+ if (mlCtrl && !(await mlCtrl.checkIsValid())) {
951
987
  valid = false;
952
988
  }
953
989
  }
954
990
  return valid;
955
991
  }
956
- async getData() {
957
- const dataMultiLanguage = [];
958
- for (const element of this.multiLanguageFunctionControl()) {
959
- dataMultiLanguage.push((await element.getData()) || {});
992
+ getData() {
993
+ const rowCount = this.dataMultiLanguage().length;
994
+ const out = [];
995
+ for (let i = 0; i < rowCount; i++) {
996
+ const ctrl = this.multiLanguageByRow().get(i);
997
+ out.push((ctrl?.getData() ?? {}));
960
998
  }
961
- // this.dataMultiLanguage.update(items => [...items]);
962
- return dataMultiLanguage;
999
+ return out;
963
1000
  }
964
- async handlerChangeValue(value, type) {
1001
+ handlerChangeValue(value, type) {
965
1002
  if (type === 'input') {
966
1003
  this.dataHeader.set(value);
967
1004
  }
968
- this.checkValidRequiredWhenInputHasValue();
1005
+ this.applyValidRequiredWhenHeaderHasValue();
969
1006
  this.outChangeValue.emit();
970
1007
  }
971
- async checkValidRequiredWhenInputHasValue() {
1008
+ applyValidRequiredWhenHeaderHasValue() {
972
1009
  this.validRequiredWhenInputHasValue.set(undefined);
973
1010
  if (!isNil(this.dataHeader())) {
974
1011
  this.validRequiredWhenInputHasValue.set({ isRequired: true });
975
1012
  }
976
1013
  }
977
1014
  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 });
1015
+ 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", outClick: "outClick", outFunctionControl: "outFunctionControl", outChangeValue: "outChangeValue" }, 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 items-center 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\n class=\"w-full\"\n (click)=\"handlerClick($event)\">\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, $index)\" />\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 (outFunctionsControl)=\"handlerFunctionsControlInputLanguage($event, $index)\" />\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"], 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 });
979
1016
  }
980
1017
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageItemsComponent, decorators: [{
981
1018
  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" }]
1019
+ 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 items-center 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\n class=\"w-full\"\n (click)=\"handlerClick($event)\">\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, $index)\" />\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 (outFunctionsControl)=\"handlerFunctionsControlInputLanguage($event, $index)\" />\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
1020
  }], ctorParameters: () => [] });
984
1021
 
985
1022
  /**