@libs-ui/components-inputs-multi-language 0.2.10-6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/esm2022/index.mjs +4 -0
- package/esm2022/interfaces/multi-language.interface.mjs +2 -0
- package/esm2022/items/items.component.mjs +152 -0
- package/esm2022/libs-ui-components-inputs-multi-language.mjs +5 -0
- package/esm2022/multi-language.component.mjs +364 -0
- package/esm2022/pipes/display-language.pipe.mjs +25 -0
- package/esm2022/pipes/get-disable-key.pipe.mjs +17 -0
- package/esm2022/pipes/get-item.pipe.mjs +18 -0
- package/esm2022/utils/multi-language.mjs +129 -0
- package/fesm2022/libs-ui-components-inputs-multi-language.mjs +689 -0
- package/fesm2022/libs-ui-components-inputs-multi-language.mjs.map +1 -0
- package/index.d.ts +3 -0
- package/interfaces/multi-language.interface.d.ts +51 -0
- package/items/items.component.d.ts +41 -0
- package/multi-language.component.d.ts +68 -0
- package/package.json +25 -0
- package/pipes/display-language.pipe.d.ts +8 -0
- package/pipes/get-disable-key.pipe.d.ts +7 -0
- package/pipes/get-item.pipe.d.ts +8 -0
- package/utils/multi-language.d.ts +24 -0
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, signal, computed, input, model, output, effect, untracked, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
|
|
4
|
+
import { LibsUiComponentsDropdownComponent } from '@libs-ui/components-dropdown';
|
|
5
|
+
import { LibsUiComponentsInputsValidComponent } from '@libs-ui/components-inputs-valid';
|
|
6
|
+
import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
|
|
7
|
+
import { CHARACTER_DATA_EMPTY, UtilsCache, get, set, cloneDeep, isNil } from '@libs-ui/utils';
|
|
8
|
+
import * as i1 from '@ngx-translate/core';
|
|
9
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
10
|
+
import { Subject, timer, takeUntil } from 'rxjs';
|
|
11
|
+
import { HttpParams } from '@angular/common/http';
|
|
12
|
+
import { returnDetailObject, returnListObject } from '@libs-ui/services-http-request';
|
|
13
|
+
import { LibsUiPipesEscapeHtmlPipe } from '@libs-ui/pipes-escape-html';
|
|
14
|
+
import { LibsUiComponentsInputsQuillComponent } from '@libs-ui/components-inputs-quill';
|
|
15
|
+
|
|
16
|
+
class LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe {
|
|
17
|
+
transform(keyLang, listLanguage) {
|
|
18
|
+
if (!keyLang || !listLanguage || !listLanguage.length) {
|
|
19
|
+
return CHARACTER_DATA_EMPTY;
|
|
20
|
+
}
|
|
21
|
+
const result = listLanguage.find(item => item.key === keyLang);
|
|
22
|
+
if (!result) {
|
|
23
|
+
return CHARACTER_DATA_EMPTY;
|
|
24
|
+
}
|
|
25
|
+
return `${result.label}: `;
|
|
26
|
+
}
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
28
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, isStandalone: true, name: "LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe" });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe, decorators: [{
|
|
31
|
+
type: Pipe,
|
|
32
|
+
args: [{
|
|
33
|
+
name: 'LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe',
|
|
34
|
+
standalone: true
|
|
35
|
+
}]
|
|
36
|
+
}] });
|
|
37
|
+
|
|
38
|
+
class LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe {
|
|
39
|
+
transform(langs, key) {
|
|
40
|
+
return langs.filter(item => item !== key);
|
|
41
|
+
}
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
43
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe, isStandalone: true, name: "LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe" });
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe, decorators: [{
|
|
46
|
+
type: Pipe,
|
|
47
|
+
args: [{
|
|
48
|
+
name: 'LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe',
|
|
49
|
+
standalone: true
|
|
50
|
+
}]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
const currenciesSupport = () => {
|
|
54
|
+
// UtilsCache.KEY_CACHE_CURRENCIES_CMS_SUPPORT
|
|
55
|
+
return UtilsCache.Get('test_currencies', ['VND', 'USD', 'EUR']);
|
|
56
|
+
};
|
|
57
|
+
const languageSupport = () => {
|
|
58
|
+
// UtilsCache.KEY_CACHE_LANGUAGE_CMS_SUPPORT
|
|
59
|
+
return UtilsCache.Get('test_lang', ['vi', 'en']);
|
|
60
|
+
};
|
|
61
|
+
const currenciesOptions = (objectPattern = { key: 'key', label: 'code' }) => {
|
|
62
|
+
const data = [
|
|
63
|
+
{ 'symbol': '$', 'name': 'US Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'USD', 'name_plural': 'US dollars', 'key': 'USD' },
|
|
64
|
+
{ 'symbol': 'CA$', 'name': 'Canadian Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'CAD', 'name_plural': 'Canadian dollars', 'key': 'CAD' },
|
|
65
|
+
{ 'symbol': '€', 'name': 'Euro', 'symbol_native': '€', 'decimal_digits': 2, 'rounding': 0, 'code': 'EUR', 'name_plural': 'euros', 'key': 'EUR' },
|
|
66
|
+
{ 'symbol': 'AED', 'name': 'United Arab Emirates Dirham', 'symbol_native': 'د.إ.', 'decimal_digits': 2, 'rounding': 0, 'code': 'AED', 'name_plural': 'UAE dirhams', 'key': 'AED' },
|
|
67
|
+
{ 'symbol': 'Af', 'name': 'Afghan Afghani', 'symbol_native': '؋', 'decimal_digits': 0, 'rounding': 0, 'code': 'AFN', 'name_plural': 'Afghan Afghanis', 'key': 'AFN' },
|
|
68
|
+
{ 'symbol': 'ALL', 'name': 'Albanian Lek', 'symbol_native': 'Lek', 'decimal_digits': 0, 'rounding': 0, 'code': 'ALL', 'name_plural': 'Albanian lekë', 'key': 'ALL' },
|
|
69
|
+
{ 'symbol': 'AMD', 'name': 'Armenian Dram', 'symbol_native': 'դր.', 'decimal_digits': 0, 'rounding': 0, 'code': 'AMD', 'name_plural': 'Armenian drams', 'key': 'AMD' },
|
|
70
|
+
{ 'symbol': 'AR$', 'name': 'Argentine Peso', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'ARS', 'name_plural': 'Argentine pesos', 'key': 'ARS' },
|
|
71
|
+
{ 'symbol': 'AU$', 'name': 'Australian Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'AUD', 'name_plural': 'Australian dollars', 'key': 'AUD' },
|
|
72
|
+
{ 'symbol': 'man.', 'name': 'Azerbaijani Manat', 'symbol_native': 'ман.', 'decimal_digits': 2, 'rounding': 0, 'code': 'AZN', 'name_plural': 'Azerbaijani manats', 'key': 'AZN' },
|
|
73
|
+
{ 'symbol': 'KM', 'name': 'Bosnia-Herzegovina Convertible Mark', 'symbol_native': 'KM', 'decimal_digits': 2, 'rounding': 0, 'code': 'BAM', 'name_plural': 'Bosnia-Herzegovina convertible marks', 'key': 'BAM' },
|
|
74
|
+
{ 'symbol': 'Tk', 'name': 'Bangladeshi Taka', 'symbol_native': '৳', 'decimal_digits': 2, 'rounding': 0, 'code': 'BDT', 'name_plural': 'Bangladeshi takas', 'key': 'BDT' },
|
|
75
|
+
{ 'symbol': 'BGN', 'name': 'Bulgarian Lev', 'symbol_native': 'лв.', 'decimal_digits': 2, 'rounding': 0, 'code': 'BGN', 'name_plural': 'Bulgarian leva', 'key': 'BGN' },
|
|
76
|
+
{ 'symbol': 'BD', 'name': 'Bahraini Dinar', 'symbol_native': 'د.ب.', 'decimal_digits': 3, 'rounding': 0, 'code': 'BHD', 'name_plural': 'Bahraini dinars', 'key': 'BHD' },
|
|
77
|
+
{ 'symbol': 'FBu', 'name': 'Burundian Franc', 'symbol_native': 'FBu', 'decimal_digits': 0, 'rounding': 0, 'code': 'BIF', 'name_plural': 'Burundian francs', 'key': 'BIF' },
|
|
78
|
+
{ 'symbol': 'BN$', 'name': 'Brunei Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'BND', 'name_plural': 'Brunei dollars', 'key': 'BND' },
|
|
79
|
+
{ 'symbol': 'Bs', 'name': 'Bolivian Boliviano', 'symbol_native': 'Bs', 'decimal_digits': 2, 'rounding': 0, 'code': 'BOB', 'name_plural': 'Bolivian bolivianos', 'key': 'BOB' },
|
|
80
|
+
{ 'symbol': 'R$', 'name': 'Brazilian Real', 'symbol_native': 'R$', 'decimal_digits': 2, 'rounding': 0, 'code': 'BRL', 'name_plural': 'Brazilian reals', 'key': 'BRL' }, { 'symbol': 'BWP', 'name': 'Botswanan Pula', 'symbol_native': 'P', 'decimal_digits': 2, 'rounding': 0, 'code': 'BWP', 'name_plural': 'Botswanan pulas', 'key': 'BWP' }, { 'symbol': 'Br', 'name': 'Belarusian Ruble', 'symbol_native': 'руб.', 'decimal_digits': 2, 'rounding': 0, 'code': 'BYN', 'name_plural': 'Belarusian rubles', 'key': 'BYN' }, { 'symbol': 'BZ$', 'name': 'Belize Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'BZD', 'name_plural': 'Belize dollars', 'key': 'BZD' }, { 'symbol': 'CDF', 'name': 'Congolese Franc', 'symbol_native': 'FrCD', 'decimal_digits': 2, 'rounding': 0, 'code': 'CDF', 'name_plural': 'Congolese francs', 'key': 'CDF' }, { 'symbol': 'CHF', 'name': 'Swiss Franc', 'symbol_native': 'CHF', 'decimal_digits': 2, 'rounding': 0.05, 'code': 'CHF', 'name_plural': 'Swiss francs', 'key': 'CHF' }, { 'symbol': 'CL$', 'name': 'Chilean Peso', 'symbol_native': '$', 'decimal_digits': 0, 'rounding': 0, 'code': 'CLP', 'name_plural': 'Chilean pesos', 'key': 'CLP' }, { 'symbol': 'CN¥', 'name': 'Chinese Yuan', 'symbol_native': 'CN¥', 'decimal_digits': 2, 'rounding': 0, 'code': 'CNY', 'name_plural': 'Chinese yuan', 'key': 'CNY' }, { 'symbol': 'CO$', 'name': 'Colombian Peso', 'symbol_native': '$', 'decimal_digits': 0, 'rounding': 0, 'code': 'COP', 'name_plural': 'Colombian pesos', 'key': 'COP' }, { 'symbol': '₡', 'name': 'Costa Rican Colón', 'symbol_native': '₡', 'decimal_digits': 0, 'rounding': 0, 'code': 'CRC', 'name_plural': 'Costa Rican colóns', 'key': 'CRC' }, { 'symbol': 'CV$', 'name': 'Cape Verdean Escudo', 'symbol_native': 'CV$', 'decimal_digits': 2, 'rounding': 0, 'code': 'CVE', 'name_plural': 'Cape Verdean escudos', 'key': 'CVE' }, { 'symbol': 'Kč', 'name': 'Czech Republic Koruna', 'symbol_native': 'Kč', 'decimal_digits': 2, 'rounding': 0, 'code': 'CZK', 'name_plural': 'Czech Republic korunas', 'key': 'CZK' }, { 'symbol': 'Fdj', 'name': 'Djiboutian Franc', 'symbol_native': 'Fdj', 'decimal_digits': 0, 'rounding': 0, 'code': 'DJF', 'name_plural': 'Djiboutian francs', 'key': 'DJF' }, { 'symbol': 'Dkr', 'name': 'Danish Krone', 'symbol_native': 'kr', 'decimal_digits': 2, 'rounding': 0, 'code': 'DKK', 'name_plural': 'Danish kroner', 'key': 'DKK' }, { 'symbol': 'RD$', 'name': 'Dominican Peso', 'symbol_native': 'RD$', 'decimal_digits': 2, 'rounding': 0, 'code': 'DOP', 'name_plural': 'Dominican pesos', 'key': 'DOP' }, { 'symbol': 'DA', 'name': 'Algerian Dinar', 'symbol_native': 'د.ج.', 'decimal_digits': 2, 'rounding': 0, 'code': 'DZD', 'name_plural': 'Algerian dinars', 'key': 'DZD' }, { 'symbol': 'Ekr', 'name': 'Estonian Kroon', 'symbol_native': 'kr', 'decimal_digits': 2, 'rounding': 0, 'code': 'EEK', 'name_plural': 'Estonian kroons', 'key': 'EEK' }, { 'symbol': 'EGP', 'name': 'Egyptian Pound', 'symbol_native': 'ج.م.', 'decimal_digits': 2, 'rounding': 0, 'code': 'EGP', 'name_plural': 'Egyptian pounds', 'key': 'EGP' }, { 'symbol': 'Nfk', 'name': 'Eritrean Nakfa', 'symbol_native': 'Nfk', 'decimal_digits': 2, 'rounding': 0, 'code': 'ERN', 'name_plural': 'Eritrean nakfas', 'key': 'ERN' }, { 'symbol': 'Br', 'name': 'Ethiopian Birr', 'symbol_native': 'Br', 'decimal_digits': 2, 'rounding': 0, 'code': 'ETB', 'name_plural': 'Ethiopian birrs', 'key': 'ETB' }, { 'symbol': '£', 'name': 'British Pound Sterling', 'symbol_native': '£', 'decimal_digits': 2, 'rounding': 0, 'code': 'GBP', 'name_plural': 'British pounds sterling', 'key': 'GBP' }, { 'symbol': 'GEL', 'name': 'Georgian Lari', 'symbol_native': 'GEL', 'decimal_digits': 2, 'rounding': 0, 'code': 'GEL', 'name_plural': 'Georgian laris', 'key': 'GEL' }, { 'symbol': 'GH₵', 'name': 'Ghanaian Cedi', 'symbol_native': 'GH₵', 'decimal_digits': 2, 'rounding': 0, 'code': 'GHS', 'name_plural': 'Ghanaian cedis', 'key': 'GHS' }, { 'symbol': 'FG', 'name': 'Guinean Franc', 'symbol_native': 'FG', 'decimal_digits': 0, 'rounding': 0, 'code': 'GNF', 'name_plural': 'Guinean francs', 'key': 'GNF' }, { 'symbol': 'GTQ', 'name': 'Guatemalan Quetzal', 'symbol_native': 'Q', 'decimal_digits': 2, 'rounding': 0, 'code': 'GTQ', 'name_plural': 'Guatemalan quetzals', 'key': 'GTQ' }, { 'symbol': 'HK$', 'name': 'Hong Kong Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'HKD', 'name_plural': 'Hong Kong dollars', 'key': 'HKD' }, { 'symbol': 'HNL', 'name': 'Honduran Lempira', 'symbol_native': 'L', 'decimal_digits': 2, 'rounding': 0, 'code': 'HNL', 'name_plural': 'Honduran lempiras', 'key': 'HNL' }, { 'symbol': 'kn', 'name': 'Croatian Kuna', 'symbol_native': 'kn', 'decimal_digits': 2, 'rounding': 0, 'code': 'HRK', 'name_plural': 'Croatian kunas', 'key': 'HRK' }, { 'symbol': 'Ft', 'name': 'Hungarian Forint', 'symbol_native': 'Ft', 'decimal_digits': 0, 'rounding': 0, 'code': 'HUF', 'name_plural': 'Hungarian forints', 'key': 'HUF' }, { 'symbol': 'Rp', 'name': 'Indonesian Rupiah', 'symbol_native': 'Rp', 'decimal_digits': 0, 'rounding': 0, 'code': 'IDR', 'name_plural': 'Indonesian rupiahs', 'key': 'IDR' }, { 'symbol': '₪', 'name': 'Israeli New Sheqel', 'symbol_native': '₪', 'decimal_digits': 2, 'rounding': 0, 'code': 'ILS', 'name_plural': 'Israeli new sheqels', 'key': 'ILS' }, { 'symbol': 'Rs', 'name': 'Indian Rupee', 'symbol_native': 'টকা', 'decimal_digits': 2, 'rounding': 0, 'code': 'INR', 'name_plural': 'Indian rupees', 'key': 'INR' }, { 'symbol': 'IQD', 'name': 'Iraqi Dinar', 'symbol_native': 'د.ع.', 'decimal_digits': 0, 'rounding': 0, 'code': 'IQD', 'name_plural': 'Iraqi dinars', 'key': 'IQD' }, { 'symbol': 'IRR', 'name': 'Iranian Rial', 'symbol_native': '﷼', 'decimal_digits': 0, 'rounding': 0, 'code': 'IRR', 'name_plural': 'Iranian rials', 'key': 'IRR' }, { 'symbol': 'Ikr', 'name': 'Icelandic Króna', 'symbol_native': 'kr', 'decimal_digits': 0, 'rounding': 0, 'code': 'ISK', 'name_plural': 'Icelandic krónur', 'key': 'ISK' }, { 'symbol': 'J$', 'name': 'Jamaican Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'JMD', 'name_plural': 'Jamaican dollars', 'key': 'JMD' }, { 'symbol': 'JD', 'name': 'Jordanian Dinar', 'symbol_native': 'د.أ.', 'decimal_digits': 3, 'rounding': 0, 'code': 'JOD', 'name_plural': 'Jordanian dinars', 'key': 'JOD' }, { 'symbol': '¥', 'name': 'Japanese Yen', 'symbol_native': '¥', 'decimal_digits': 0, 'rounding': 0, 'code': 'JPY', 'name_plural': 'Japanese yen', 'key': 'JPY' }, { 'symbol': 'Ksh', 'name': 'Kenyan Shilling', 'symbol_native': 'Ksh', 'decimal_digits': 2, 'rounding': 0, 'code': 'KES', 'name_plural': 'Kenyan shillings', 'key': 'KES' }, { 'symbol': 'KHR', 'name': 'Cambodian Riel', 'symbol_native': '៛', 'decimal_digits': 2, 'rounding': 0, 'code': 'KHR', 'name_plural': 'Cambodian riels', 'key': 'KHR' }, { 'symbol': 'CF', 'name': 'Comorian Franc', 'symbol_native': 'FC', 'decimal_digits': 0, 'rounding': 0, 'code': 'KMF', 'name_plural': 'Comorian francs', 'key': 'KMF' }, { 'symbol': '₩', 'name': 'South Korean Won', 'symbol_native': '₩', 'decimal_digits': 0, 'rounding': 0, 'code': 'KRW', 'name_plural': 'South Korean won', 'key': 'KRW' }, { 'symbol': 'KD', 'name': 'Kuwaiti Dinar', 'symbol_native': 'د.ك.', 'decimal_digits': 3, 'rounding': 0, 'code': 'KWD', 'name_plural': 'Kuwaiti dinars', 'key': 'KWD' }, { 'symbol': 'KZT', 'name': 'Kazakhstani Tenge', 'symbol_native': 'тңг.', 'decimal_digits': 2, 'rounding': 0, 'code': 'KZT', 'name_plural': 'Kazakhstani tenges', 'key': 'KZT' }, { 'symbol': 'LB£', 'name': 'Lebanese Pound', 'symbol_native': 'ل.ل.', 'decimal_digits': 0, 'rounding': 0, 'code': 'LBP', 'name_plural': 'Lebanese pounds', 'key': 'LBP' }, { 'symbol': 'SLRs', 'name': 'Sri Lankan Rupee', 'symbol_native': 'SL Re', 'decimal_digits': 2, 'rounding': 0, 'code': 'LKR', 'name_plural': 'Sri Lankan rupees', 'key': 'LKR' }, { 'symbol': 'Lt', 'name': 'Lithuanian Litas', 'symbol_native': 'Lt', 'decimal_digits': 2, 'rounding': 0, 'code': 'LTL', 'name_plural': 'Lithuanian litai', 'key': 'LTL' }, { 'symbol': 'Ls', 'name': 'Latvian Lats', 'symbol_native': 'Ls', 'decimal_digits': 2, 'rounding': 0, 'code': 'LVL', 'name_plural': 'Latvian lati', 'key': 'LVL' }, { 'symbol': 'LD', 'name': 'Libyan Dinar', 'symbol_native': 'د.ل.', 'decimal_digits': 3, 'rounding': 0, 'code': 'LYD', 'name_plural': 'Libyan dinars', 'key': 'LYD' }, { 'symbol': 'MAD', 'name': 'Moroccan Dirham', 'symbol_native': 'د.م.', 'decimal_digits': 2, 'rounding': 0, 'code': 'MAD', 'name_plural': 'Moroccan dirhams', 'key': 'MAD' }, { 'symbol': 'MDL', 'name': 'Moldovan Leu', 'symbol_native': 'MDL', 'decimal_digits': 2, 'rounding': 0, 'code': 'MDL', 'name_plural': 'Moldovan lei', 'key': 'MDL' }, { 'symbol': 'MGA', 'name': 'Malagasy Ariary', 'symbol_native': 'MGA', 'decimal_digits': 0, 'rounding': 0, 'code': 'MGA', 'name_plural': 'Malagasy Ariaries', 'key': 'MGA' }, { 'symbol': 'MKD', 'name': 'Macedonian Denar', 'symbol_native': 'MKD', 'decimal_digits': 2, 'rounding': 0, 'code': 'MKD', 'name_plural': 'Macedonian denari', 'key': 'MKD' }, { 'symbol': 'MMK', 'name': 'Myanma Kyat', 'symbol_native': 'K', 'decimal_digits': 0, 'rounding': 0, 'code': 'MMK', 'name_plural': 'Myanma kyats', 'key': 'MMK' }, { 'symbol': 'MOP$', 'name': 'Macanese Pataca', 'symbol_native': 'MOP$', 'decimal_digits': 2, 'rounding': 0, 'code': 'MOP', 'name_plural': 'Macanese patacas', 'key': 'MOP' }, { 'symbol': 'MURs', 'name': 'Mauritian Rupee', 'symbol_native': 'MURs', 'decimal_digits': 0, 'rounding': 0, 'code': 'MUR', 'name_plural': 'Mauritian rupees', 'key': 'MUR' }, { 'symbol': 'MX$', 'name': 'Mexican Peso', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'MXN', 'name_plural': 'Mexican pesos', 'key': 'MXN' }, { 'symbol': 'RM', 'name': 'Malaysian Ringgit', 'symbol_native': 'RM', 'decimal_digits': 2, 'rounding': 0, 'code': 'MYR', 'name_plural': 'Malaysian ringgits', 'key': 'MYR' }, { 'symbol': 'MTn', 'name': 'Mozambican Metical', 'symbol_native': 'MTn', 'decimal_digits': 2, 'rounding': 0, 'code': 'MZN', 'name_plural': 'Mozambican meticals', 'key': 'MZN' }, { 'symbol': 'N$', 'name': 'Namibian Dollar', 'symbol_native': 'N$', 'decimal_digits': 2, 'rounding': 0, 'code': 'NAD', 'name_plural': 'Namibian dollars', 'key': 'NAD' }, { 'symbol': '₦', 'name': 'Nigerian Naira', 'symbol_native': '₦', 'decimal_digits': 2, 'rounding': 0, 'code': 'NGN', 'name_plural': 'Nigerian nairas', 'key': 'NGN' }, { 'symbol': 'C$', 'name': 'Nicaraguan Córdoba', 'symbol_native': 'C$', 'decimal_digits': 2, 'rounding': 0, 'code': 'NIO', 'name_plural': 'Nicaraguan córdobas', 'key': 'NIO' }, { 'symbol': 'Nkr', 'name': 'Norwegian Krone', 'symbol_native': 'kr', 'decimal_digits': 2, 'rounding': 0, 'code': 'NOK', 'name_plural': 'Norwegian kroner', 'key': 'NOK' }, { 'symbol': 'NPRs', 'name': 'Nepalese Rupee', 'symbol_native': 'नेरू', 'decimal_digits': 2, 'rounding': 0, 'code': 'NPR', 'name_plural': 'Nepalese rupees', 'key': 'NPR' }, { 'symbol': 'NZ$', 'name': 'New Zealand Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'NZD', 'name_plural': 'New Zealand dollars', 'key': 'NZD' }, { 'symbol': 'OMR', 'name': 'Omani Rial', 'symbol_native': 'ر.ع.', 'decimal_digits': 3, 'rounding': 0, 'code': 'OMR', 'name_plural': 'Omani rials', 'key': 'OMR' }, { 'symbol': 'B/.', 'name': 'Panamanian Balboa', 'symbol_native': 'B/.', 'decimal_digits': 2, 'rounding': 0, 'code': 'PAB', 'name_plural': 'Panamanian balboas', 'key': 'PAB' }, { 'symbol': 'S/.', 'name': 'Peruvian Nuevo Sol', 'symbol_native': 'S/.', 'decimal_digits': 2, 'rounding': 0, 'code': 'PEN', 'name_plural': 'Peruvian nuevos soles', 'key': 'PEN' }, { 'symbol': '₱', 'name': 'Philippine Peso', 'symbol_native': '₱', 'decimal_digits': 2, 'rounding': 0, 'code': 'PHP', 'name_plural': 'Philippine pesos', 'key': 'PHP' }, { 'symbol': 'PKRs', 'name': 'Pakistani Rupee', 'symbol_native': '₨', 'decimal_digits': 0, 'rounding': 0, 'code': 'PKR', 'name_plural': 'Pakistani rupees', 'key': 'PKR' }, { 'symbol': 'zł', 'name': 'Polish Zloty', 'symbol_native': 'zł', 'decimal_digits': 2, 'rounding': 0, 'code': 'PLN', 'name_plural': 'Polish zlotys', 'key': 'PLN' }, { 'symbol': '₲', 'name': 'Paraguayan Guarani', 'symbol_native': '₲', 'decimal_digits': 0, 'rounding': 0, 'code': 'PYG', 'name_plural': 'Paraguayan guaranis', 'key': 'PYG' }, { 'symbol': 'QR', 'name': 'Qatari Rial', 'symbol_native': 'ر.ق.', 'decimal_digits': 2, 'rounding': 0, 'code': 'QAR', 'name_plural': 'Qatari rials', 'key': 'QAR' }, { 'symbol': 'RON', 'name': 'Romanian Leu', 'symbol_native': 'RON', 'decimal_digits': 2, 'rounding': 0, 'code': 'RON', 'name_plural': 'Romanian lei', 'key': 'RON' }, { 'symbol': 'din.', 'name': 'Serbian Dinar', 'symbol_native': 'дин.', 'decimal_digits': 0, 'rounding': 0, 'code': 'RSD', 'name_plural': 'Serbian dinars', 'key': 'RSD' }, { 'symbol': 'RUB', 'name': 'Russian Ruble', 'symbol_native': '₽.', 'decimal_digits': 2, 'rounding': 0, 'code': 'RUB', 'name_plural': 'Russian rubles', 'key': 'RUB' }, { 'symbol': 'RWF', 'name': 'Rwandan Franc', 'symbol_native': 'FR', 'decimal_digits': 0, 'rounding': 0, 'code': 'RWF', 'name_plural': 'Rwandan francs', 'key': 'RWF' }, { 'symbol': 'SR', 'name': 'Saudi Riyal', 'symbol_native': 'ر.س.', 'decimal_digits': 2, 'rounding': 0, 'code': 'SAR', 'name_plural': 'Saudi riyals', 'key': 'SAR' }, { 'symbol': 'SDG', 'name': 'Sudanese Pound', 'symbol_native': 'SDG', 'decimal_digits': 2, 'rounding': 0, 'code': 'SDG', 'name_plural': 'Sudanese pounds', 'key': 'SDG' }, { 'symbol': 'Skr', 'name': 'Swedish Krona', 'symbol_native': 'kr', 'decimal_digits': 2, 'rounding': 0, 'code': 'SEK', 'name_plural': 'Swedish kronor', 'key': 'SEK' }, { 'symbol': 'S$', 'name': 'Singapore Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'SGD', 'name_plural': 'Singapore dollars', 'key': 'SGD' }, { 'symbol': 'Ssh', 'name': 'Somali Shilling', 'symbol_native': 'Ssh', 'decimal_digits': 0, 'rounding': 0, 'code': 'SOS', 'name_plural': 'Somali shillings', 'key': 'SOS' }, { 'symbol': 'SY£', 'name': 'Syrian Pound', 'symbol_native': 'ل.س.', 'decimal_digits': 0, 'rounding': 0, 'code': 'SYP', 'name_plural': 'Syrian pounds', 'key': 'SYP' }, { 'symbol': '฿', 'name': 'Thai Baht', 'symbol_native': '฿', 'decimal_digits': 2, 'rounding': 0, 'code': 'THB', 'name_plural': 'Thai baht', 'key': 'THB' }, { 'symbol': 'DT', 'name': 'Tunisian Dinar', 'symbol_native': 'د.ت.', 'decimal_digits': 3, 'rounding': 0, 'code': 'TND', 'name_plural': 'Tunisian dinars', 'key': 'TND' }, { 'symbol': 'T$', 'name': 'Tongan Paʻanga', 'symbol_native': 'T$', 'decimal_digits': 2, 'rounding': 0, 'code': 'TOP', 'name_plural': 'Tongan paʻanga', 'key': 'TOP' }, { 'symbol': 'TL', 'name': 'Turkish Lira', 'symbol_native': 'TL', 'decimal_digits': 2, 'rounding': 0, 'code': 'TRY', 'name_plural': 'Turkish Lira', 'key': 'TRY' }, { 'symbol': 'TT$', 'name': 'Trinidad and Tobago Dollar', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'TTD', 'name_plural': 'Trinidad and Tobago dollars', 'key': 'TTD' }, { 'symbol': 'NT$', 'name': 'New Taiwan Dollar', 'symbol_native': 'NT$', 'decimal_digits': 2, 'rounding': 0, 'code': 'TWD', 'name_plural': 'New Taiwan dollars', 'key': 'TWD' }, { 'symbol': 'TSh', 'name': 'Tanzanian Shilling', 'symbol_native': 'TSh', 'decimal_digits': 0, 'rounding': 0, 'code': 'TZS', 'name_plural': 'Tanzanian shillings', 'key': 'TZS' }, { 'symbol': '₴', 'name': 'Ukrainian Hryvnia', 'symbol_native': '₴', 'decimal_digits': 2, 'rounding': 0, 'code': 'UAH', 'name_plural': 'Ukrainian hryvnias', 'key': 'UAH' }, { 'symbol': 'USh', 'name': 'Ugandan Shilling', 'symbol_native': 'USh', 'decimal_digits': 0, 'rounding': 0, 'code': 'UGX', 'name_plural': 'Ugandan shillings', 'key': 'UGX' }, { 'symbol': '$U', 'name': 'Uruguayan Peso', 'symbol_native': '$', 'decimal_digits': 2, 'rounding': 0, 'code': 'UYU', 'name_plural': 'Uruguayan pesos', 'key': 'UYU' }, { 'symbol': 'UZS', 'name': 'Uzbekistan Som', 'symbol_native': 'UZS', 'decimal_digits': 0, 'rounding': 0, 'code': 'UZS', 'name_plural': 'Uzbekistan som', 'key': 'UZS' }, { 'symbol': 'Bs.F.', 'name': 'Venezuelan Bolívar', 'symbol_native': 'Bs.F.', 'decimal_digits': 2, 'rounding': 0, 'code': 'VEF', 'name_plural': 'Venezuelan bolívars', 'key': 'VEF' }, { 'symbol': '₫', 'name': 'Vietnamese Dong', 'symbol_native': '₫', 'decimal_digits': 0, 'rounding': 0, 'code': 'VND', 'name_plural': 'Vietnamese dong', 'key': 'VND' }, { 'symbol': 'FCFA', 'name': 'CFA Franc BEAC', 'symbol_native': 'FCFA', 'decimal_digits': 0, 'rounding': 0, 'code': 'XAF', 'name_plural': 'CFA francs BEAC', 'key': 'XAF' }, { 'symbol': 'CFA', 'name': 'CFA Franc BCEAO', 'symbol_native': 'CFA', 'decimal_digits': 0, 'rounding': 0, 'code': 'XOF', 'name_plural': 'CFA francs BCEAO', 'key': 'XOF' }, { 'symbol': 'YR', 'name': 'Yemeni Rial', 'symbol_native': 'ر.ي.', 'decimal_digits': 0, 'rounding': 0, 'code': 'YER', 'name_plural': 'Yemeni rials', 'key': 'YER' }, { 'symbol': 'R', 'name': 'South African Rand', 'symbol_native': 'R', 'decimal_digits': 2, 'rounding': 0, 'code': 'ZAR', 'name_plural': 'South African rand', 'key': 'ZAR' }, { 'symbol': 'ZK', 'name': 'Zambian Kwacha', 'symbol_native': 'ZK', 'decimal_digits': 0, 'rounding': 0, 'code': 'ZMK', 'name_plural': 'Zambian kwachas', 'key': 'ZMK' }, { 'symbol': 'ZWL$', 'name': 'Zimbabwean Dollar', 'symbol_native': 'ZWL$', 'decimal_digits': 0, 'rounding': 0, 'code': 'ZWL', 'name_plural': 'Zimbabwean Dollar', 'key': 'ZWL' }
|
|
81
|
+
];
|
|
82
|
+
const dataurrenciesSupportData = [];
|
|
83
|
+
currenciesSupport().forEach((key) => {
|
|
84
|
+
const found = data.find(item => item.key === key);
|
|
85
|
+
if (found) {
|
|
86
|
+
dataurrenciesSupportData.push(found);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return convertObjectOfArray(objectPattern, dataurrenciesSupportData);
|
|
90
|
+
};
|
|
91
|
+
const langOptions = (objectPattern = { key: 'key', label: 'nativeName' }) => {
|
|
92
|
+
const data = [{ 'name': 'Abkhaz', 'nativeName': 'аҧсуа', 'key': 'ab' }, { 'name': 'Afar', 'nativeName': 'Afaraf', 'key': 'aa' }, { 'name': 'Afrikaans', 'nativeName': 'Afrikaans', 'key': 'af' }, { 'name': 'Akan', 'nativeName': 'Akan', 'key': 'ak' }, { 'name': 'Albanian', 'nativeName': 'Shqip', 'key': 'sq' }, { 'name': 'Amharic', 'nativeName': 'አማርኛ', 'key': 'am' }, { 'name': 'Arabic', 'nativeName': 'العربية', 'key': 'ar' }, { 'name': 'Aragonese', 'nativeName': 'Aragonés', 'key': 'an' }, { 'name': 'Armenian', 'nativeName': 'Հայերեն', 'key': 'hy' }, { 'name': 'Assamese', 'nativeName': 'অসমীয়া', 'key': 'as' }, { 'name': 'Avaric', 'nativeName': 'авар мацӀ, магӀарул мацӀ', 'key': 'av' }, { 'name': 'Avestan', 'nativeName': 'avesta', 'key': 'ae' }, { 'name': 'Aymara', 'nativeName': 'aymar aru', 'key': 'ay' }, { 'name': 'Azerbaijani', 'nativeName': 'azərbaycan dili', 'key': 'az' }, { 'name': 'Bambara', 'nativeName': 'bamanankan', 'key': 'bm' }, { 'name': 'Bashkir', 'nativeName': 'башҡорт теле', 'key': 'ba' }, { 'name': 'Basque', 'nativeName': 'euskara, euskera', 'key': 'eu' }, { 'name': 'Belarusian', 'nativeName': 'Беларуская', 'key': 'be' }, { 'name': 'Bengali', 'nativeName': 'বাংলা', 'key': 'bn' }, { 'name': 'Bihari', 'nativeName': 'भोजपुरी', 'key': 'bh' }, { 'name': 'Bislama', 'nativeName': 'Bislama', 'key': 'bi' }, { 'name': 'Bosnian', 'nativeName': 'bosanski jezik', 'key': 'bs' }, { 'name': 'Breton', 'nativeName': 'brezhoneg', 'key': 'br' }, { 'name': 'Bulgarian', 'nativeName': 'български език', 'key': 'bg' }, { 'name': 'Burmese', 'nativeName': 'ဗမာစာ', 'key': 'my' }, { 'name': 'Catalan; Valencian', 'nativeName': 'Català', 'key': 'ca' }, { 'name': 'Chamorro', 'nativeName': 'Chamoru', 'key': 'ch' }, { 'name': 'Chechen', 'nativeName': 'нохчийн мотт', 'key': 'ce' }, { 'name': 'Chichewa; Chewa; Nyanja', 'nativeName': 'chiCheŵa, chinyanja', 'key': 'ny' }, { 'name': 'Chinese', 'nativeName': '中文 (Zhōngwén), 汉语, 漢語', 'key': 'zh' }, { 'name': 'Chuvash', 'nativeName': 'чӑваш чӗлхи', 'key': 'cv' }, { 'name': 'Cornish', 'nativeName': 'Kernewek', 'key': 'kw' }, { 'name': 'Corsican', 'nativeName': 'corsu, lingua corsa', 'key': 'co' }, { 'name': 'Cree', 'nativeName': 'ᓀᐦᐃᔭᐍᐏᐣ', 'key': 'cr' }, { 'name': 'Croatian', 'nativeName': 'hrvatski', 'key': 'hr' }, { 'name': 'Czech', 'nativeName': 'česky, čeština', 'key': 'cs' }, { 'name': 'Danish', 'nativeName': 'dansk', 'key': 'da' }, { 'name': 'Divehi; Dhivehi; Maldivian;', 'nativeName': 'ދިވެހި', 'key': 'dv' }, { 'name': 'Dutch', 'nativeName': 'Nederlands, Vlaams', 'key': 'nl' }, { 'name': 'English', 'nativeName': 'English', 'key': 'en' }, { 'name': 'Esperanto', 'nativeName': 'Esperanto', 'key': 'eo' }, { 'name': 'Estonian', 'nativeName': 'eesti, eesti keel', 'key': 'et' }, { 'name': 'Ewe', 'nativeName': 'Eʋegbe', 'key': 'ee' }, { 'name': 'Faroese', 'nativeName': 'føroyskt', 'key': 'fo' }, { 'name': 'Fijian', 'nativeName': 'vosa Vakaviti', 'key': 'fj' }, { 'name': 'Finnish', 'nativeName': 'suomi, suomen kieli', 'key': 'fi' }, { 'name': 'French', 'nativeName': 'français, langue française', 'key': 'fr' }, { 'name': 'Fula; Fulah; Pulaar; Pular', 'nativeName': 'Fulfulde, Pulaar, Pular', 'key': 'ff' }, { 'name': 'Galician', 'nativeName': 'Galego', 'key': 'gl' }, { 'name': 'Georgian', 'nativeName': 'ქართული', 'key': 'ka' }, { 'name': 'German', 'nativeName': 'Deutsch', 'key': 'de' }, { 'name': 'Greek, Modern', 'nativeName': 'Ελληνικά', 'key': 'el' }, { 'name': 'Guaraní', 'nativeName': 'Avañeẽ', 'key': 'gn' }, { 'name': 'Gujarati', 'nativeName': 'ગુજરાતી', 'key': 'gu' }, { 'name': 'Haitian; Haitian Creole', 'nativeName': 'Kreyòl ayisyen', 'key': 'ht' }, { 'name': 'Hausa', 'nativeName': 'Hausa, هَوُسَ', 'key': 'ha' }, { 'name': 'Hebrew (modern)', 'nativeName': 'עברית', 'key': 'he' }, { 'name': 'Herero', 'nativeName': 'Otjiherero', 'key': 'hz' }, { 'name': 'Hindi', 'nativeName': 'हिन्दी, हिंदी', 'key': 'hi' }, { 'name': 'Hiri Motu', 'nativeName': 'Hiri Motu', 'key': 'ho' }, { 'name': 'Hungarian', 'nativeName': 'Magyar', 'key': 'hu' }, { 'name': 'Interlingua', 'nativeName': 'Interlingua', 'key': 'ia' }, { 'name': 'Indonesian', 'nativeName': 'Bahasa Indonesia', 'key': 'id' }, { 'name': 'Interlingue', 'nativeName': 'Originally called Occidental; then Interlingue after WWII', 'key': 'ie' }, { 'name': 'Irish', 'nativeName': 'Gaeilge', 'key': 'ga' }, { 'name': 'Igbo', 'nativeName': 'Asụsụ Igbo', 'key': 'ig' }, { 'name': 'Inupiaq', 'nativeName': 'Iñupiaq, Iñupiatun', 'key': 'ik' }, { 'name': 'Ido', 'nativeName': 'Ido', 'key': 'io' }, { 'name': 'Icelandic', 'nativeName': 'Íslenska', 'key': 'is' }, { 'name': 'Italian', 'nativeName': 'Italiano', 'key': 'it' }, { 'name': 'Inuktitut', 'nativeName': 'ᐃᓄᒃᑎᑐᑦ', 'key': 'iu' }, { 'name': 'Japanese', 'nativeName': '日本語 (にほんご/にっぽんご)', 'key': 'ja' }, { 'name': 'Javanese', 'nativeName': 'basa Jawa', 'key': 'jv' }, { 'name': 'Kalaallisut, Greenlandic', 'nativeName': 'kalaallisut, kalaallit oqaasii', 'key': 'kl' }, { 'name': 'Kannada', 'nativeName': 'ಕನ್ನಡ', 'key': 'kn' }, { 'name': 'Kanuri', 'nativeName': 'Kanuri', 'key': 'kr' }, { 'name': 'Kashmiri', 'nativeName': 'कश्मीरी, كشميري', 'key': 'ks' }, { 'name': 'Kazakh', 'nativeName': 'Қазақ тілі', 'key': 'kk' }, { 'name': 'Khmer', 'nativeName': 'ភាសាខ្មែរ', 'key': 'km' }, { 'name': 'Kikuyu, Gikuyu', 'nativeName': 'Gĩkũyũ', 'key': 'ki' }, { 'name': 'Kinyarwanda', 'nativeName': 'Ikinyarwanda', 'key': 'rw' }, { 'name': 'Kirghiz, Kyrgyz', 'nativeName': 'кыргыз тили', 'key': 'ky' }, { 'name': 'Komi', 'nativeName': 'коми кыв', 'key': 'kv' }, { 'name': 'Kongo', 'nativeName': 'KiKongo', 'key': 'kg' }, { 'name': 'Korean', 'nativeName': '한국어 (韓國語), 조선말 (朝鮮語)', 'key': 'ko' }, { 'name': 'Kurdish', 'nativeName': 'Kurdî, كوردی', 'key': 'ku' }, { 'name': 'Kwanyama, Kuanyama', 'nativeName': 'Kuanyama', 'key': 'kj' }, { 'name': 'Latin', 'nativeName': 'latine, lingua latina', 'key': 'la' }, { 'name': 'Luxembourgish, Letzeburgesch', 'nativeName': 'Lëtzebuergesch', 'key': 'lb' }, { 'name': 'Luganda', 'nativeName': 'Luganda', 'key': 'lg' }, { 'name': 'Limburgish, Limburgan, Limburger', 'nativeName': 'Limburgs', 'key': 'li' }, { 'name': 'Lingala', 'nativeName': 'Lingála', 'key': 'ln' }, { 'name': 'Lao', 'nativeName': 'ພາສາລາວ', 'key': 'lo' }, { 'name': 'Lithuanian', 'nativeName': 'lietuvių kalba', 'key': 'lt' }, { 'name': 'Luba-Katanga', 'nativeName': 'Luba-Katanga', 'key': 'lu' }, { 'name': 'Latvian', 'nativeName': 'latviešu valoda', 'key': 'lv' }, { 'name': 'Manx', 'nativeName': 'Gaelg, Gailck', 'key': 'gv' }, { 'name': 'Macedonian', 'nativeName': 'македонски јазик', 'key': 'mk' }, { 'name': 'Malagasy', 'nativeName': 'Malagasy fiteny', 'key': 'mg' }, { 'name': 'Malay', 'nativeName': 'bahasa Melayu, بهاس ملايو', 'key': 'ms' }, { 'name': 'Malayalam', 'nativeName': 'മലയാളം', 'key': 'ml' }, { 'name': 'Maltese', 'nativeName': 'Malti', 'key': 'mt' }, { 'name': 'Māori', 'nativeName': 'te reo Māori', 'key': 'mi' }, { 'name': 'Marathi (Marāṭhī)', 'nativeName': 'मराठी', 'key': 'mr' }, { 'name': 'Marshallese', 'nativeName': 'Kajin M̧ajeļ', 'key': 'mh' }, { 'name': 'Mongolian', 'nativeName': 'монгол', 'key': 'mn' }, { 'name': 'Nauru', 'nativeName': 'Ekakairũ Naoero', 'key': 'na' }, { 'name': 'Navajo, Navaho', 'nativeName': 'Diné bizaad, Dinékʼehǰí', 'key': 'nv' }, { 'name': 'Norwegian Bokmål', 'nativeName': 'Norsk bokmål', 'key': 'nb' }, { 'name': 'North Ndebele', 'nativeName': 'isiNdebele', 'key': 'nd' }, { 'name': 'Nepali', 'nativeName': 'नेपाली', 'key': 'ne' }, { 'name': 'Ndonga', 'nativeName': 'Owambo', 'key': 'ng' }, { 'name': 'Norwegian Nynorsk', 'nativeName': 'Norsk nynorsk', 'key': 'nn' }, { 'name': 'Norwegian', 'nativeName': 'Norsk', 'key': 'no' }, { 'name': 'Nuosu', 'nativeName': 'ꆈꌠ꒿ Nuosuhxop', 'key': 'ii' }, { 'name': 'South Ndebele', 'nativeName': 'isiNdebele', 'key': 'nr' }, { 'name': 'Occitan', 'nativeName': 'Occitan', 'key': 'oc' }, { 'name': 'Ojibwe, Ojibwa', 'nativeName': 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'key': 'oj' }, { 'name': 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic', 'nativeName': 'ѩзыкъ словѣньскъ', 'key': 'cu' }, { 'name': 'Oromo', 'nativeName': 'Afaan Oromoo', 'key': 'om' }, { 'name': 'Oriya', 'nativeName': 'ଓଡ଼ିଆ', 'key': 'or' }, { 'name': 'Ossetian, Ossetic', 'nativeName': 'ирон æвзаг', 'key': 'os' }, { 'name': 'Panjabi, Punjabi', 'nativeName': 'ਪੰਜਾਬੀ, پنجابی', 'key': 'pa' }, { 'name': 'Pāli', 'nativeName': 'पाऴि', 'key': 'pi' }, { 'name': 'Persian', 'nativeName': 'فارسی', 'key': 'fa' }, { 'name': 'Polish', 'nativeName': 'polski', 'key': 'pl' }, { 'name': 'Pashto, Pushto', 'nativeName': 'پښتو', 'key': 'ps' }, { 'name': 'Portuguese', 'nativeName': 'Português', 'key': 'pt' }, { 'name': 'Quechua', 'nativeName': 'Runa Simi, Kichwa', 'key': 'qu' }, { 'name': 'Romansh', 'nativeName': 'rumantsch grischun', 'key': 'rm' }, { 'name': 'Kirundi', 'nativeName': 'kiRundi', 'key': 'rn' }, { 'name': 'Romanian, Moldavian, Moldovan', 'nativeName': 'română', 'key': 'ro' }, { 'name': 'Russian', 'nativeName': 'русский язык', 'key': 'ru' }, { 'name': 'Sanskrit (Saṁskṛta)', 'nativeName': 'संस्कृतम्', 'key': 'sa' }, { 'name': 'Sardinian', 'nativeName': 'sardu', 'key': 'sc' }, { 'name': 'Sindhi', 'nativeName': 'सिन्धी, سنڌي، سندھی', 'key': 'sd' }, { 'name': 'Northern Sami', 'nativeName': 'Davvisámegiella', 'key': 'se' }, { 'name': 'Samoan', 'nativeName': 'gagana faa Samoa', 'key': 'sm' }, { 'name': 'Sango', 'nativeName': 'yângâ tî sängö', 'key': 'sg' }, { 'name': 'Serbian', 'nativeName': 'српски језик', 'key': 'sr' }, { 'name': 'Scottish Gaelic; Gaelic', 'nativeName': 'Gàidhlig', 'key': 'gd' }, { 'name': 'Shona', 'nativeName': 'chiShona', 'key': 'sn' }, { 'name': 'Sinhala, Sinhalese', 'nativeName': 'සිංහල', 'key': 'si' }, { 'name': 'Slovak', 'nativeName': 'slovenčina', 'key': 'sk' }, { 'name': 'Slovene', 'nativeName': 'slovenščina', 'key': 'sl' }, { 'name': 'Somali', 'nativeName': 'Soomaaliga, af Soomaali', 'key': 'so' }, { 'name': 'Southern Sotho', 'nativeName': 'Sesotho', 'key': 'st' }, { 'name': 'Spanish; Castilian', 'nativeName': 'español, castellano', 'key': 'es' }, { 'name': 'Sundanese', 'nativeName': 'Basa Sunda', 'key': 'su' }, { 'name': 'Swahili', 'nativeName': 'Kiswahili', 'key': 'sw' }, { 'name': 'Swati', 'nativeName': 'SiSwati', 'key': 'ss' }, { 'name': 'Swedish', 'nativeName': 'svenska', 'key': 'sv' }, { 'name': 'Tamil', 'nativeName': 'தமிழ்', 'key': 'ta' }, { 'name': 'Telugu', 'nativeName': 'తెలుగు', 'key': 'te' }, { 'name': 'Tajik', 'nativeName': 'тоҷикӣ, toğikī, تاجیکی', 'key': 'tg' }, { 'name': 'Thai', 'nativeName': 'ไทย', 'key': 'th' }, { 'name': 'Tigrinya', 'nativeName': 'ትግርኛ', 'key': 'ti' }, { 'name': 'Tibetan Standard, Tibetan, Central', 'nativeName': 'བོད་ཡིག', 'key': 'bo' }, { 'name': 'Turkmen', 'nativeName': 'Türkmen, Түркмен', 'key': 'tk' }, { 'name': 'Tagalog', 'nativeName': 'Wikang Tagalog, ᜏᜒᜃᜅ᜔ ᜆᜄᜎᜓᜄ᜔', 'key': 'tl' }, { 'name': 'Tswana', 'nativeName': 'Setswana', 'key': 'tn' }, { 'name': 'Tonga (Tonga Islands)', 'nativeName': 'faka Tonga', 'key': 'to' }, { 'name': 'Turkish', 'nativeName': 'Türkçe', 'key': 'tr' }, { 'name': 'Tsonga', 'nativeName': 'Xitsonga', 'key': 'ts' }, { 'name': 'Tatar', 'nativeName': 'татарча, tatarça, تاتارچا', 'key': 'tt' }, { 'name': 'Twi', 'nativeName': 'Twi', 'key': 'tw' }, { 'name': 'Tahitian', 'nativeName': 'Reo Tahiti', 'key': 'ty' }, { 'name': 'Uighur, Uyghur', 'nativeName': 'Uyƣurqə, ئۇيغۇرچە', 'key': 'ug' }, { 'name': 'Ukrainian', 'nativeName': 'українська', 'key': 'uk' }, { 'name': 'Urdu', 'nativeName': 'اردو', 'key': 'ur' }, { 'name': 'Uzbek', 'nativeName': 'zbek, Ўзбек, أۇزبېك', 'key': 'uz' }, { 'name': 'Venda', 'nativeName': 'Tshivenḓa', 'key': 've' }, { 'name': 'Vietnamese', 'nativeName': 'Tiếng Việt', 'key': 'vi' }, { 'name': 'Volapük', 'nativeName': 'Volapük', 'key': 'vo' }, { 'name': 'Walloon', 'nativeName': 'Walon', 'key': 'wa' }, { 'name': 'Welsh', 'nativeName': 'Cymraeg', 'key': 'cy' }, { 'name': 'Wolof', 'nativeName': 'Wollof', 'key': 'wo' }, { 'name': 'Western Frisian', 'nativeName': 'Frysk', 'key': 'fy' }, { 'name': 'Xhosa', 'nativeName': 'isiXhosa', 'key': 'xh' }, { 'name': 'Yiddish', 'nativeName': 'ייִדיש', 'key': 'yi' }, { 'name': 'Yoruba', 'nativeName': 'Yorùbá', 'key': 'yo' }, { 'name': 'Zhuang, Chuang', 'nativeName': 'Saɯ cueŋƅ, Saw cuengh', 'key': 'za' }];
|
|
93
|
+
const languageSupportData = [];
|
|
94
|
+
languageSupport().forEach((key) => {
|
|
95
|
+
const found = data.find(item => item.key === key);
|
|
96
|
+
if (found) {
|
|
97
|
+
languageSupportData.push(found);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return convertObjectOfArray(objectPattern, languageSupportData);
|
|
101
|
+
};
|
|
102
|
+
const convertObjectOfArray = (objectPattern, data) => {
|
|
103
|
+
if (!objectPattern || !Object.keys(objectPattern).length) {
|
|
104
|
+
return data;
|
|
105
|
+
}
|
|
106
|
+
return data.map(item => {
|
|
107
|
+
return convertObject(objectPattern, item);
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
const convertObject = (objectPattern, data) => {
|
|
111
|
+
if (!objectPattern || !Object.keys(objectPattern).length) {
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
114
|
+
const keys = Object.keys(objectPattern);
|
|
115
|
+
const objectConvert = {};
|
|
116
|
+
keys.forEach((key => {
|
|
117
|
+
const valKey = get(objectPattern, key);
|
|
118
|
+
if (!valKey || !(typeof valKey === 'string')) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const keysObject = valKey.split('.');
|
|
122
|
+
const value = getDataObject(keysObject, data);
|
|
123
|
+
set(objectConvert, key, value);
|
|
124
|
+
}));
|
|
125
|
+
return objectConvert;
|
|
126
|
+
};
|
|
127
|
+
const getDataObject = (keysObject, object) => {
|
|
128
|
+
let value = object;
|
|
129
|
+
const length = keysObject.length;
|
|
130
|
+
for (let i = 0; i < length; i++) {
|
|
131
|
+
const key = keysObject[i];
|
|
132
|
+
if (!key) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
const valueKey = get(value, key);
|
|
136
|
+
if (!valueKey) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
value = valueKey;
|
|
140
|
+
}
|
|
141
|
+
return value;
|
|
142
|
+
};
|
|
143
|
+
const httpRequestDetail = (options) => {
|
|
144
|
+
return {
|
|
145
|
+
serviceOther: returnDetailObject(new HttpParams({ fromObject: { fieldKey: 'key' } }), options),
|
|
146
|
+
functionName: 'detailByData',
|
|
147
|
+
argumentsValue: [''],
|
|
148
|
+
guideAutoUpdateArgumentsValue: {
|
|
149
|
+
paging: {},
|
|
150
|
+
detailById: {
|
|
151
|
+
fieldUpdate: '[0]',
|
|
152
|
+
fieldGetValue: ''
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const listConfigItem = (options) => {
|
|
158
|
+
return {
|
|
159
|
+
type: 'text',
|
|
160
|
+
httpRequestData: signal({
|
|
161
|
+
serviceOther: returnListObject(options),
|
|
162
|
+
functionName: 'list',
|
|
163
|
+
argumentsValue: ['']
|
|
164
|
+
}),
|
|
165
|
+
configTemplateText: signal({
|
|
166
|
+
fieldKey: 'key',
|
|
167
|
+
getValue: (item) => `${item.label}`
|
|
168
|
+
})
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
const validRequired = () => {
|
|
172
|
+
return {
|
|
173
|
+
message: '',
|
|
174
|
+
isRequired: false
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
class LibsUiComponentsInputsMultiLanguageGetItemPipe {
|
|
179
|
+
transform(keyBindData, dataLanguageChange) {
|
|
180
|
+
return (keyBindData ? signal(get(dataLanguageChange, keyBindData)) : dataLanguageChange);
|
|
181
|
+
}
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
183
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetItemPipe, isStandalone: true, name: "LibsUiComponentsInputsMultiLanguageGetItemPipe" });
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageGetItemPipe, decorators: [{
|
|
186
|
+
type: Pipe,
|
|
187
|
+
args: [{
|
|
188
|
+
name: 'LibsUiComponentsInputsMultiLanguageGetItemPipe',
|
|
189
|
+
standalone: true
|
|
190
|
+
}]
|
|
191
|
+
}] });
|
|
192
|
+
|
|
193
|
+
class LibsUiComponentsInputsMultiLanguageComponent {
|
|
194
|
+
/* PROPERTY */
|
|
195
|
+
languageDisplay = signal([]);
|
|
196
|
+
dataLanguageChange = signal({});
|
|
197
|
+
langDefault = signal(languageSupport());
|
|
198
|
+
currencyUnits = signal([]);
|
|
199
|
+
options = signal(langOptions());
|
|
200
|
+
validRequiredDefault = signal(validRequired());
|
|
201
|
+
listConfigItem = computed(() => listConfigItem(this.options()));
|
|
202
|
+
httpRequestDetail = computed(() => httpRequestDetail(this.options()));
|
|
203
|
+
inputFunctionControl = signal(new Map());
|
|
204
|
+
quillFunctionControl = signal([]);
|
|
205
|
+
onDestroy = new Subject();
|
|
206
|
+
/* INPUT */
|
|
207
|
+
zIndex = input();
|
|
208
|
+
viewType = input('text', { transform: value => value ?? 'text' });
|
|
209
|
+
singleLanguage = input();
|
|
210
|
+
data = model([]);
|
|
211
|
+
validRequired = input(validRequired(), { transform: value => value ?? validRequired() });
|
|
212
|
+
ignoreAdd = model();
|
|
213
|
+
titleField = input();
|
|
214
|
+
keyHeader = input();
|
|
215
|
+
textArea = input();
|
|
216
|
+
placeholder = input();
|
|
217
|
+
extendClass = model();
|
|
218
|
+
extendClassContent = input();
|
|
219
|
+
viewPosition = input('row');
|
|
220
|
+
ignoreRemove = input();
|
|
221
|
+
validMaxLength = input({ length: 0 }, { transform: value => value ?? { length: 0 } });
|
|
222
|
+
validMinLength = input();
|
|
223
|
+
countCharacters = input();
|
|
224
|
+
viewContent = input();
|
|
225
|
+
classIncludeKey = input('libs-ui-font-h4r');
|
|
226
|
+
classIncludeValue = input('libs-ui-font-h4s');
|
|
227
|
+
dataLanguage = model({});
|
|
228
|
+
multiLine = input();
|
|
229
|
+
readonly = input();
|
|
230
|
+
acceptNegativeValue = input();
|
|
231
|
+
valueUpDownNumber = input();
|
|
232
|
+
maxValueNumber = input();
|
|
233
|
+
onlyAcceptNegativeValue = input();
|
|
234
|
+
/* OUTPUT */
|
|
235
|
+
outEventMultiLanguage = output();
|
|
236
|
+
outChangeTypeLanguage = output();
|
|
237
|
+
outFunctionsControl = output();
|
|
238
|
+
outChangeValueInput = output();
|
|
239
|
+
constructor() {
|
|
240
|
+
effect(() => {
|
|
241
|
+
const viewType = this.viewType();
|
|
242
|
+
untracked(() => {
|
|
243
|
+
if (viewType === 'integer') {
|
|
244
|
+
this.langDefault.set(currenciesSupport());
|
|
245
|
+
this.options.set(currenciesOptions());
|
|
246
|
+
this.options().forEach(item => {
|
|
247
|
+
this.currencyUnits().push({
|
|
248
|
+
label: item.label,
|
|
249
|
+
id: item.key,
|
|
250
|
+
type: item.label
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
this.currencyUnits.update(value => [...value]);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
effect(() => {
|
|
258
|
+
untracked(() => {
|
|
259
|
+
const dataLanguage = this.dataLanguage();
|
|
260
|
+
this.dataLanguageChange.set(cloneDeep(dataLanguage));
|
|
261
|
+
this.generateData();
|
|
262
|
+
const optionsSelected = new Set();
|
|
263
|
+
Object.keys(this.dataLanguageChange()).forEach((key) => {
|
|
264
|
+
if (this.options().find(item => item.key === key)) {
|
|
265
|
+
optionsSelected.add(key);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
if (this.langDefault().length) {
|
|
269
|
+
this.langDefault().forEach((key) => {
|
|
270
|
+
if (!isNil(get(this.dataLanguageChange, key))) {
|
|
271
|
+
optionsSelected.add(key);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
this.languageDisplay.set(Array.from(optionsSelected));
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
effect(() => {
|
|
279
|
+
const singleLanguage = this.singleLanguage();
|
|
280
|
+
untracked(() => {
|
|
281
|
+
this.outChangeTypeLanguage.emit(true);
|
|
282
|
+
if (!singleLanguage) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const key = this.langDefault()[0];
|
|
286
|
+
this.dataLanguage.update(value => ({ ...value, [key]: get(this.dataLanguageChange, key) }));
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
effect(() => {
|
|
290
|
+
const validRequired = this.validRequired();
|
|
291
|
+
untracked(() => {
|
|
292
|
+
if (!validRequired) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
this.validRequiredDefault.update(value => ({ ...value, isRequired: validRequired.isRequired }));
|
|
296
|
+
if (!validRequired.isRequired) {
|
|
297
|
+
this.validate();
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
ngOnInit() {
|
|
303
|
+
this.outFunctionsControl.emit({
|
|
304
|
+
checkIsValid: this.validate.bind(this),
|
|
305
|
+
getData: this.getData.bind(this)
|
|
306
|
+
});
|
|
307
|
+
this.extendClass.update(value => `${value || ''} ${this.viewPosition() === 'row' ? 'flex-row' : 'flex-col'}`);
|
|
308
|
+
}
|
|
309
|
+
async handlerInputFunctionControl(event, key) {
|
|
310
|
+
this.inputFunctionControl().set(key, event);
|
|
311
|
+
}
|
|
312
|
+
async handlerQuillFunctionControl(event) {
|
|
313
|
+
this.quillFunctionControl.update(items => [...items, event]);
|
|
314
|
+
}
|
|
315
|
+
async handlerSelectChange(event, keyOld) {
|
|
316
|
+
if (!event || event.key === keyOld) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this.languageDisplay.update(value => value.map(item => item === keyOld ? event.key : item));
|
|
320
|
+
delete this.dataLanguageChange()[keyOld];
|
|
321
|
+
delete this.dataLanguage()[keyOld];
|
|
322
|
+
this.setDefaultData(event.key);
|
|
323
|
+
}
|
|
324
|
+
async handlerAddLanguage(event) {
|
|
325
|
+
event.stopPropagation();
|
|
326
|
+
const lang = this.options().find(item => !this.languageDisplay().includes(item.key));
|
|
327
|
+
if (!lang) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
this.languageDisplay.update(value => [...value, lang.key]);
|
|
331
|
+
this.setDefaultData(lang.key);
|
|
332
|
+
if (this.options().length === this.languageDisplay().length) {
|
|
333
|
+
this.ignoreAdd.set(true);
|
|
334
|
+
}
|
|
335
|
+
this.outEventMultiLanguage.emit({ action: 'add', data: this.dataLanguageChange() });
|
|
336
|
+
}
|
|
337
|
+
async handlerRemoveLanguage(event, key) {
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
this.ignoreAdd.set(true);
|
|
340
|
+
this.dataLanguageChange.update(value => {
|
|
341
|
+
delete value[key];
|
|
342
|
+
return { ...value };
|
|
343
|
+
});
|
|
344
|
+
this.validateIsMultiKey();
|
|
345
|
+
this.languageDisplay.update(value => value.filter(item => item !== key));
|
|
346
|
+
this.outEventMultiLanguage.emit({ action: 'remove', data: this.dataLanguageChange() });
|
|
347
|
+
this.inputFunctionControl().delete(key);
|
|
348
|
+
}
|
|
349
|
+
async getData() {
|
|
350
|
+
if (this.singleLanguage()) {
|
|
351
|
+
const key = this.langDefault()[0];
|
|
352
|
+
this.dataLanguage.update(value => ({ ...value, [key]: get(this.dataLanguageChange, key) }));
|
|
353
|
+
return this.dataLanguage();
|
|
354
|
+
}
|
|
355
|
+
if (this.data().length > 1) {
|
|
356
|
+
for (const item of this.data()) {
|
|
357
|
+
const lang = this.langDefault()[0];
|
|
358
|
+
const key = item.keyBindData;
|
|
359
|
+
const dataByKey = key ? get(this.dataLanguageChange, key) : undefined;
|
|
360
|
+
if (key && dataByKey && lang && !get(dataByKey, lang) && !get(this.dataLanguageChange, lang)) {
|
|
361
|
+
return {};
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return this.dataLanguageChange();
|
|
366
|
+
}
|
|
367
|
+
async generateData() {
|
|
368
|
+
const lang = this.langDefault()[0];
|
|
369
|
+
if (this.data().length) {
|
|
370
|
+
this.data().forEach((item, index) => {
|
|
371
|
+
const key = item.keyBindData;
|
|
372
|
+
if (!index && isNil(get(this.dataLanguageChange, lang))) {
|
|
373
|
+
this.setDefaultData(lang);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (!key || !isNil(get(this.dataLanguageChange, key))) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
this.dataLanguageChange.update(value => ({ ...value, [key]: { [lang]: '' } }));
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
if (!this.data().length) {
|
|
383
|
+
if (!this.dataLanguage() || !Object.keys(this.dataLanguage()).length) {
|
|
384
|
+
this.setDefaultData(lang);
|
|
385
|
+
}
|
|
386
|
+
this.data.set([{
|
|
387
|
+
type: this.viewType(),
|
|
388
|
+
placeholder: this.placeholder(),
|
|
389
|
+
isOneValue: false,
|
|
390
|
+
keyBindData: ''
|
|
391
|
+
}]);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
async setDefaultData(key) {
|
|
395
|
+
this.dataLanguageChange.update(value => ({ ...value, [key]: '' }));
|
|
396
|
+
this.dataLanguage.update(value => ({ ...value, [key]: '' }));
|
|
397
|
+
}
|
|
398
|
+
async validate() {
|
|
399
|
+
let valid = true;
|
|
400
|
+
for (const control of this.inputFunctionControl().values()) {
|
|
401
|
+
if (!(await control.checkIsValid())) {
|
|
402
|
+
valid = false;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
for (const control of this.quillFunctionControl()) {
|
|
406
|
+
if (!(await control.checkIsValid())) {
|
|
407
|
+
valid = false;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (this.singleLanguage()) {
|
|
411
|
+
return valid;
|
|
412
|
+
}
|
|
413
|
+
if (this.data().length === 1) {
|
|
414
|
+
await this.validateDefault();
|
|
415
|
+
}
|
|
416
|
+
this.validateIsMultiKey();
|
|
417
|
+
return valid;
|
|
418
|
+
}
|
|
419
|
+
async validateDefault() {
|
|
420
|
+
let valid = true;
|
|
421
|
+
if (this.validRequired().isRequired) {
|
|
422
|
+
this.validRequiredDefault.update(value => ({ ...value, isRequired: true }));
|
|
423
|
+
if (!(await this.checkValidInput())) {
|
|
424
|
+
valid = false;
|
|
425
|
+
}
|
|
426
|
+
return valid;
|
|
427
|
+
}
|
|
428
|
+
if (Object.keys(this.dataLanguageChange()).length === 1) {
|
|
429
|
+
this.validRequiredDefault.update(value => ({ ...value, isRequired: false }));
|
|
430
|
+
if (!(await this.checkValidInput())) {
|
|
431
|
+
valid = false;
|
|
432
|
+
}
|
|
433
|
+
return valid;
|
|
434
|
+
}
|
|
435
|
+
for (const key of Object.keys(this.dataLanguageChange())) {
|
|
436
|
+
if (key !== 'id' && key !== this.keyHeader() && get(this.dataLanguageChange, key) && key !== this.langDefault()[0]) {
|
|
437
|
+
this.validRequiredDefault.update(value => ({ ...value, isRequired: true }));
|
|
438
|
+
if (!(await this.checkValidInput())) {
|
|
439
|
+
valid = false;
|
|
440
|
+
}
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this.validRequiredDefault.update(value => ({ ...value, isRequired: false }));
|
|
444
|
+
if (!(await this.checkValidInput())) {
|
|
445
|
+
valid = false;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return valid;
|
|
449
|
+
}
|
|
450
|
+
async checkValidInput() {
|
|
451
|
+
let valid = true;
|
|
452
|
+
for (const control of this.inputFunctionControl().values()) {
|
|
453
|
+
if (!(await control.checkIsValid())) {
|
|
454
|
+
valid = false;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return valid;
|
|
458
|
+
}
|
|
459
|
+
async validateIsMultiKey() {
|
|
460
|
+
if (this.data().length > 1) {
|
|
461
|
+
if (this.data()[0].validRequired?.isRequired) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
this.data().forEach((item) => {
|
|
465
|
+
if (!item.keyBindData) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
Object.keys(get(this.dataLanguageChange, item.keyBindData)).forEach(async (keyBind) => {
|
|
469
|
+
for (const key of Object.keys(this.dataLanguageChange())) {
|
|
470
|
+
if (key === item.keyBindData || key === keyBind) {
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
if (get(this.dataLanguageChange, key) && this.options().find(item => item.key === key)) {
|
|
474
|
+
this.data().forEach(async (config) => {
|
|
475
|
+
if (config && config.validRequiredLangDefault) {
|
|
476
|
+
config.validRequiredLangDefault.isRequired = true;
|
|
477
|
+
await this.checkValidInput();
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
this.data().forEach(async (config) => {
|
|
483
|
+
if (config && config.validRequiredLangDefault) {
|
|
484
|
+
config.validRequiredLangDefault.isRequired = false;
|
|
485
|
+
await this.checkValidInput();
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
const dataLanguageChangeByKeyBind = get(this.dataLanguageChange, keyBind);
|
|
490
|
+
const dataLanguageChangeByKeyBindData = item.keyBindData ? get(this.dataLanguageChange, item.keyBindData) : undefined;
|
|
491
|
+
if ((!dataLanguageChangeByKeyBind && !get(dataLanguageChangeByKeyBindData, keyBind)) || (dataLanguageChangeByKeyBind && get(dataLanguageChangeByKeyBindData, keyBind))) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
if (!dataLanguageChangeByKeyBind) {
|
|
495
|
+
const dataFirst = this.data()[0];
|
|
496
|
+
if (dataFirst && dataFirst.validRequiredLangDefault) {
|
|
497
|
+
dataFirst.validRequiredLangDefault.isRequired = true;
|
|
498
|
+
await this.checkValidInput();
|
|
499
|
+
}
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
if (!get(dataLanguageChangeByKeyBindData, keyBind)) {
|
|
503
|
+
const dataSecond = this.data()[1];
|
|
504
|
+
if (dataSecond && dataSecond.validRequiredLangDefault) {
|
|
505
|
+
dataSecond.validRequiredLangDefault.isRequired = true;
|
|
506
|
+
await this.checkValidInput();
|
|
507
|
+
}
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
async handlerInputChange() {
|
|
515
|
+
this.outChangeValueInput.emit();
|
|
516
|
+
timer(500).pipe(takeUntil(this.onDestroy)).subscribe(() => this.validate());
|
|
517
|
+
}
|
|
518
|
+
ngOnDestroy() {
|
|
519
|
+
this.onDestroy.next();
|
|
520
|
+
this.onDestroy.complete();
|
|
521
|
+
}
|
|
522
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
523
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsInputsMultiLanguageComponent, isStandalone: true, selector: "libs_ui-components-inputs-multi_language", inputs: { 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 } }, 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 [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 [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 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 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 <libs_ui-components-inputs-valid [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]=\"(item.placeholder || '') | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"($index === 0 && data().length <= 1) ? validRequiredDefault() : \n ($index === 0 && data().length > 1 && item.validRequiredLangDefault) ? item.validRequiredLangDefault : item.validRequired ? item.validRequired : (validRequired() || { isRequired: false })\"\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]=\"{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 <libs_ui-components-inputs-quill [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [validRequired]=\"($index === 0 && data().length <= 1) ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"(item.placeholder || '') | 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 [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 [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 class=\"flex\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe:options()\" />\n </div>\n }\n <div 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 [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 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", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "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", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "hiddenContent", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "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"], 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"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "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: ["optionsToolbar", "showToolBar", "classIncludeToolbar", "placeholder", "label", "item", "fieldNameBind", "readonly", "showErrorLabel", "showErrorBorder", "onlyShowErrorBorderInContent", "classIncludeTemplate", "classInclude", "handlersExpand", "validRequired", "validMinLength", "validMaxLength", "onlyShowContent", "zIndex", "dataConfigMention", "heightAuto", "autoFocus", "autoFocusBottom", "templateToolBarPersonalize", "template", "uploadImageConfig"], outputs: ["itemChange", "outMessageError", "outBlur", "outFocus", "outChange", "outFunctionsControl", "outSelectionChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
524
|
+
}
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageComponent, decorators: [{
|
|
526
|
+
type: Component,
|
|
527
|
+
args: [{ selector: 'libs_ui-components-inputs-multi_language', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
528
|
+
TranslateModule,
|
|
529
|
+
LibsUiComponentsDropdownComponent,
|
|
530
|
+
LibsUiComponentsInputsValidComponent,
|
|
531
|
+
LibsUiComponentsButtonsButtonComponent,
|
|
532
|
+
LibsUiComponentsPopoverComponent,
|
|
533
|
+
LibsUiComponentsInputsMultiLanguageGetDisableKeyPipe,
|
|
534
|
+
LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe,
|
|
535
|
+
LibsUiComponentsInputsMultiLanguageGetItemPipe,
|
|
536
|
+
LibsUiPipesEscapeHtmlPipe,
|
|
537
|
+
LibsUiComponentsInputsQuillComponent
|
|
538
|
+
], 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 [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 [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 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 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 <libs_ui-components-inputs-valid [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]=\"(item.placeholder || '') | translate\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [validRequired]=\"($index === 0 && data().length <= 1) ? validRequiredDefault() : \n ($index === 0 && data().length > 1 && item.validRequiredLangDefault) ? item.validRequiredLangDefault : item.validRequired ? item.validRequired : (validRequired() || { isRequired: false })\"\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]=\"{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 <libs_ui-components-inputs-quill [(item)]=\"itemMap\"\n [fieldNameBind]=\"key\"\n [validRequired]=\"($index === 0 && data().length <= 1) ? validRequiredDefault() : validRequired()\"\n [placeholder]=\"(item.placeholder || '') | 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 [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 [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 class=\"flex\"\n [class.hidden]=\"singleLanguage() && !$first\"\n [class.mt-[4px]]=\"!singleLanguage() && !$first\">\n <libs_ui-components-popover [type]=\"'text'\"\n [classInclude]=\"classIncludeKey()\"\n [innerHTML]=\"key | LibsUiComponentsInputsMultiLanguageDisplayLanguagePipe:options()\" />\n </div>\n }\n <div 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 [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 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" }]
|
|
539
|
+
}], ctorParameters: () => [] });
|
|
540
|
+
|
|
541
|
+
class LibsUiComponentsInputsMultiLanguageItemsComponent {
|
|
542
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
543
|
+
dataMultiKey = signal([]);
|
|
544
|
+
langDefault = signal(UtilsCache.getLang());
|
|
545
|
+
configHeader = signal(undefined);
|
|
546
|
+
validRequired = signal({ isRequired: false });
|
|
547
|
+
validRequiredWhenInputHasValue = signal(undefined);
|
|
548
|
+
dataHeader = signal(undefined);
|
|
549
|
+
multiLanguageFunctionControl = signal([]);
|
|
550
|
+
inputValidFunctionControl = signal([]);
|
|
551
|
+
configItems = input([]);
|
|
552
|
+
dataMultiLanguage = model([{}]);
|
|
553
|
+
zIndex = input();
|
|
554
|
+
ignoreAdd = input();
|
|
555
|
+
labelAddItem = input();
|
|
556
|
+
singleLanguage = input();
|
|
557
|
+
acceptNegativeValue = input();
|
|
558
|
+
valueUpDownNumber = input();
|
|
559
|
+
maxValueNumber = input();
|
|
560
|
+
onlyAcceptNegativeValue = input();
|
|
561
|
+
outClick = output();
|
|
562
|
+
outFunctionControl = output();
|
|
563
|
+
outChangeValue = output();
|
|
564
|
+
constructor() {
|
|
565
|
+
effect(() => {
|
|
566
|
+
const configItems = this.configItems();
|
|
567
|
+
untracked(() => {
|
|
568
|
+
if (configItems && configItems.length) {
|
|
569
|
+
this.configHeader.set(configItems[0].header);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
effect(() => {
|
|
574
|
+
const dataMultiLanguage = this.dataMultiLanguage();
|
|
575
|
+
untracked(() => {
|
|
576
|
+
if (!dataMultiLanguage || !dataMultiLanguage.length) {
|
|
577
|
+
this.dataMultiLanguage.set([{}]);
|
|
578
|
+
const configHeader = this.configHeader();
|
|
579
|
+
if (configHeader && configHeader.dataDefault) {
|
|
580
|
+
this.dataMultiLanguage.set([cloneDeep(configHeader.dataDefault)]);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
this.handlerConfigMulti();
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
ngOnInit() {
|
|
588
|
+
this.outFunctionControl.emit({
|
|
589
|
+
checkIsValid: this.validate.bind(this),
|
|
590
|
+
getData: this.getData.bind(this)
|
|
591
|
+
});
|
|
592
|
+
const configItems = this.configItems();
|
|
593
|
+
if (configItems && configItems.length && configItems[0].validRequired) {
|
|
594
|
+
this.validRequired.set(configItems[0].validRequired);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
async handlerConfigMulti() {
|
|
598
|
+
this.dataMultiKey.set([]);
|
|
599
|
+
this.dataMultiLanguage().forEach(() => {
|
|
600
|
+
const configItems = this.configItems();
|
|
601
|
+
if (configItems) {
|
|
602
|
+
this.dataMultiKey().push(configItems);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
this.dataMultiKey.update(items => [...items]);
|
|
606
|
+
}
|
|
607
|
+
async handlerAdd() {
|
|
608
|
+
let dataLanguage = {};
|
|
609
|
+
const configHeader = this.configHeader();
|
|
610
|
+
if (configHeader) {
|
|
611
|
+
dataLanguage = cloneDeep(configHeader.dataDefault);
|
|
612
|
+
}
|
|
613
|
+
this.dataMultiLanguage.update(items => [...items, dataLanguage]);
|
|
614
|
+
this.dataMultiKey.update(items => [...items, this.configItems()]);
|
|
615
|
+
this.handlerChangeValue();
|
|
616
|
+
}
|
|
617
|
+
async handlerRemove(index) {
|
|
618
|
+
this.dataMultiLanguage.update(items => {
|
|
619
|
+
items.splice(index, 1);
|
|
620
|
+
return [...items];
|
|
621
|
+
});
|
|
622
|
+
this.handlerChangeValue();
|
|
623
|
+
}
|
|
624
|
+
async handlerClick(e) {
|
|
625
|
+
e.stopPropagation();
|
|
626
|
+
this.outClick.emit();
|
|
627
|
+
}
|
|
628
|
+
async handlerFunctionsControlInputLanguage(event) {
|
|
629
|
+
this.multiLanguageFunctionControl.update(items => [...items, event]);
|
|
630
|
+
}
|
|
631
|
+
async handlerFunctionsControlInputValid(event) {
|
|
632
|
+
this.inputValidFunctionControl.update(items => [...items, event]);
|
|
633
|
+
}
|
|
634
|
+
async validate() {
|
|
635
|
+
let valid = true;
|
|
636
|
+
this.checkValidRequiredWhenInputHasValue();
|
|
637
|
+
for (const control of this.inputValidFunctionControl()) {
|
|
638
|
+
if (!(await control.checkIsValid())) {
|
|
639
|
+
valid = false;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
for (const control of this.multiLanguageFunctionControl()) {
|
|
643
|
+
if (!(await control.checkIsValid())) {
|
|
644
|
+
valid = false;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return valid;
|
|
648
|
+
}
|
|
649
|
+
async getData() {
|
|
650
|
+
const dataMultiLanguage = [];
|
|
651
|
+
for (const element of this.multiLanguageFunctionControl()) {
|
|
652
|
+
dataMultiLanguage.push(await element.getData() || {});
|
|
653
|
+
}
|
|
654
|
+
// this.dataMultiLanguage.update(items => [...items]);
|
|
655
|
+
return dataMultiLanguage;
|
|
656
|
+
}
|
|
657
|
+
async handlerChangeValue(value, type) {
|
|
658
|
+
if (type === 'input') {
|
|
659
|
+
this.dataHeader.set(value);
|
|
660
|
+
}
|
|
661
|
+
this.checkValidRequiredWhenInputHasValue();
|
|
662
|
+
this.outChangeValue.emit();
|
|
663
|
+
}
|
|
664
|
+
async checkValidRequiredWhenInputHasValue() {
|
|
665
|
+
this.validRequiredWhenInputHasValue.set(undefined);
|
|
666
|
+
if (!isNil(this.dataHeader())) {
|
|
667
|
+
this.validRequiredWhenInputHasValue.set({ isRequired: true });
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
671
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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 class=\"flex w-full\"\n [class.mt-[12px]]=\"!$first\">\n <div 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\">{{ (configHeader.title ?? ' ') | translate }}</div>\n <div (click)=\"handlerClick($event)\"\n class=\"pl-[8px]\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe:item; as itemMap) {\n <libs_ui-components-inputs-valid [(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 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 [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 [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", "resetAutoCompletePassword", "textAreaEnterNotNewLine", "hiddenContent", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "ignoreWidthInput100", "classIncludeInput", "classContainerInput", "readonly", "disable", "noBorder", "backgroundNone", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "classContainerBottomInput", "autoRemoveEmoji", "defaultHeight", "maxHeightTextArea", "minHeightTextArea", "ignoreShowError", "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"], 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: ["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"], 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"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
672
|
+
}
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsMultiLanguageItemsComponent, decorators: [{
|
|
674
|
+
type: Component,
|
|
675
|
+
args: [{ selector: 'libs_ui-components-inputs-multi_language-items', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
676
|
+
TranslateModule,
|
|
677
|
+
LibsUiComponentsInputsMultiLanguageGetItemPipe,
|
|
678
|
+
LibsUiComponentsInputsValidComponent,
|
|
679
|
+
LibsUiComponentsInputsMultiLanguageComponent,
|
|
680
|
+
LibsUiComponentsButtonsButtonComponent
|
|
681
|
+
], template: "<div class=\"mt-[4px]\">\n @for (item of dataMultiLanguage(); track item) {\n <div class=\"flex w-full\"\n [class.mt-[12px]]=\"!$first\">\n <div 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\">{{ (configHeader.title ?? ' ') | translate }}</div>\n <div (click)=\"handlerClick($event)\"\n class=\"pl-[8px]\">\n @if (configHeader.keyBindData | LibsUiComponentsInputsMultiLanguageGetItemPipe:item; as itemMap) {\n <libs_ui-components-inputs-valid [(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 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 [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 [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" }]
|
|
682
|
+
}], ctorParameters: () => [] });
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Generated bundle index. Do not edit.
|
|
686
|
+
*/
|
|
687
|
+
|
|
688
|
+
export { LibsUiComponentsInputsMultiLanguageComponent, LibsUiComponentsInputsMultiLanguageItemsComponent };
|
|
689
|
+
//# sourceMappingURL=libs-ui-components-inputs-multi-language.mjs.map
|