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