mapa-library-ui 2.16.0 → 2.17.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/fesm2022/mapa-library-ui-src-lib-components-capability.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +19 -5
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +19 -5
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-input.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-input.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs +17 -3
- package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs.map +1 -1
- package/fesm2022/mapa-library-ui.mjs +19 -5
- package/fesm2022/mapa-library-ui.mjs.map +1 -1
- package/mapa-library-ui-2.17.1.tgz +0 -0
- package/package.json +1 -1
- package/mapa-library-ui-2.16.0.tgz +0 -0
|
@@ -8,7 +8,7 @@ import { merge, EMPTY } from 'rxjs';
|
|
|
8
8
|
import * as i1 from '@angular/common';
|
|
9
9
|
import { CommonModule } from '@angular/common';
|
|
10
10
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
-
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts } from 'mapa-frontend-i18n';
|
|
11
|
+
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getMapaUiTexts } from 'mapa-frontend-i18n';
|
|
12
12
|
import * as i1$1 from '@angular/platform-browser';
|
|
13
13
|
import * as i1$3 from '@angular/material/icon';
|
|
14
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
@@ -200,11 +200,25 @@ const DEFAULT_MAPA_UI_TEXTS = {
|
|
|
200
200
|
launchOptions: MAPA_UI_TEXTS_PT_BR.launchOptions,
|
|
201
201
|
fileDrop: MAPA_UI_TEXTS_PT_BR.fileDrop,
|
|
202
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* Padrão dos textos: pt-BR, ou o idioma salvo pelo app (`menu.language`).
|
|
205
|
+
*
|
|
206
|
+
* Cada entry point da lib (table, dropdown, chart…) é empacotado com a própria cópia
|
|
207
|
+
* deste módulo — e do `MapaI18nService` —, então o `provideMapaUiTexts`/`setTexts` do app
|
|
208
|
+
* nem sempre chega nele. Sem isso, componentes como a paginação da `mapa-table` ficavam em
|
|
209
|
+
* pt-BR mesmo com o app em en/es. Textos passados pelo app continuam vencendo o padrão.
|
|
210
|
+
*/
|
|
203
211
|
function getDefaultTexts() {
|
|
204
|
-
|
|
212
|
+
const language = getStoredAppLanguage();
|
|
213
|
+
if (language === 'pt-BR') {
|
|
214
|
+
return DEFAULT_MAPA_UI_TEXTS;
|
|
215
|
+
}
|
|
216
|
+
return mergeTexts(DEFAULT_MAPA_UI_TEXTS, getMapaUiTexts(language));
|
|
205
217
|
}
|
|
206
218
|
function mergeMapaUiTexts(customTexts) {
|
|
207
|
-
|
|
219
|
+
return mergeTexts(getDefaultTexts(), customTexts);
|
|
220
|
+
}
|
|
221
|
+
function mergeTexts(defaults, customTexts) {
|
|
208
222
|
return {
|
|
209
223
|
export: { ...defaults.export, ...(customTexts?.export ?? {}) },
|
|
210
224
|
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|