mapa-library-ui 2.15.1 → 2.17.0
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 +31 -0
- 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 +17 -3
- 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 +17 -3
- 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 +275 -40
- package/fesm2022/mapa-library-ui.mjs.map +1 -1
- package/index.d.ts +57 -2
- package/mapa-library-ui-2.17.0.tgz +0 -0
- package/package.json +1 -1
- package/mapa-library-ui-2.15.1.tgz +0 -0
|
@@ -14,7 +14,7 @@ import * as i3 from '@angular/material/menu';
|
|
|
14
14
|
import { MatMenuModule } from '@angular/material/menu';
|
|
15
15
|
import { RouterLink } from '@angular/router';
|
|
16
16
|
import * as i1$1 from '@angular/platform-browser';
|
|
17
|
-
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getIntlLocale } from 'mapa-frontend-i18n';
|
|
17
|
+
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getMapaUiTexts, getIntlLocale } from 'mapa-frontend-i18n';
|
|
18
18
|
import * as i1$2 from '@angular/common/http';
|
|
19
19
|
|
|
20
20
|
class BubblePaginationDirective {
|
|
@@ -474,11 +474,25 @@ const DEFAULT_MAPA_UI_TEXTS = {
|
|
|
474
474
|
launchOptions: MAPA_UI_TEXTS_PT_BR.launchOptions,
|
|
475
475
|
fileDrop: MAPA_UI_TEXTS_PT_BR.fileDrop,
|
|
476
476
|
};
|
|
477
|
+
/**
|
|
478
|
+
* Padrão dos textos: pt-BR, ou o idioma salvo pelo app (`menu.language`).
|
|
479
|
+
*
|
|
480
|
+
* Cada entry point da lib (table, dropdown, chart…) é empacotado com a própria cópia
|
|
481
|
+
* deste módulo — e do `MapaI18nService` —, então o `provideMapaUiTexts`/`setTexts` do app
|
|
482
|
+
* nem sempre chega nele. Sem isso, componentes como a paginação da `mapa-table` ficavam em
|
|
483
|
+
* pt-BR mesmo com o app em en/es. Textos passados pelo app continuam vencendo o padrão.
|
|
484
|
+
*/
|
|
477
485
|
function getDefaultTexts() {
|
|
478
|
-
|
|
486
|
+
const language = getStoredAppLanguage();
|
|
487
|
+
if (language === 'pt-BR') {
|
|
488
|
+
return DEFAULT_MAPA_UI_TEXTS;
|
|
489
|
+
}
|
|
490
|
+
return mergeTexts(DEFAULT_MAPA_UI_TEXTS, getMapaUiTexts(language));
|
|
479
491
|
}
|
|
480
492
|
function mergeMapaUiTexts(customTexts) {
|
|
481
|
-
|
|
493
|
+
return mergeTexts(getDefaultTexts(), customTexts);
|
|
494
|
+
}
|
|
495
|
+
function mergeTexts(defaults, customTexts) {
|
|
482
496
|
return {
|
|
483
497
|
export: { ...defaults.export, ...(customTexts?.export ?? {}) },
|
|
484
498
|
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|