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
|
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { Injectable, Input, Component, inject, DestroyRef, EnvironmentInjector, createComponent, HostListener, Directive, SecurityContext, Pipe, InjectionToken, Injector, signal, Optional, Inject, EventEmitter, Output, ViewChild, ChangeDetectionStrategy } from '@angular/core';
|
|
5
5
|
import * as i1$1 from '@angular/platform-browser';
|
|
6
6
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts } from 'mapa-frontend-i18n';
|
|
7
|
+
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getMapaUiTexts } from 'mapa-frontend-i18n';
|
|
8
8
|
import { Md5 } from 'ts-md5';
|
|
9
9
|
import * as i2 from '@angular/material/expansion';
|
|
10
10
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
@@ -571,11 +571,25 @@ const DEFAULT_MAPA_UI_TEXTS = {
|
|
|
571
571
|
launchOptions: MAPA_UI_TEXTS_PT_BR.launchOptions,
|
|
572
572
|
fileDrop: MAPA_UI_TEXTS_PT_BR.fileDrop,
|
|
573
573
|
};
|
|
574
|
+
/**
|
|
575
|
+
* Padrão dos textos: pt-BR, ou o idioma salvo pelo app (`menu.language`).
|
|
576
|
+
*
|
|
577
|
+
* Cada entry point da lib (table, dropdown, chart…) é empacotado com a própria cópia
|
|
578
|
+
* deste módulo — e do `MapaI18nService` —, então o `provideMapaUiTexts`/`setTexts` do app
|
|
579
|
+
* nem sempre chega nele. Sem isso, componentes como a paginação da `mapa-table` ficavam em
|
|
580
|
+
* pt-BR mesmo com o app em en/es. Textos passados pelo app continuam vencendo o padrão.
|
|
581
|
+
*/
|
|
574
582
|
function getDefaultTexts() {
|
|
575
|
-
|
|
583
|
+
const language = getStoredAppLanguage();
|
|
584
|
+
if (language === 'pt-BR') {
|
|
585
|
+
return DEFAULT_MAPA_UI_TEXTS;
|
|
586
|
+
}
|
|
587
|
+
return mergeTexts(DEFAULT_MAPA_UI_TEXTS, getMapaUiTexts(language));
|
|
576
588
|
}
|
|
577
589
|
function mergeMapaUiTexts(customTexts) {
|
|
578
|
-
|
|
590
|
+
return mergeTexts(getDefaultTexts(), customTexts);
|
|
591
|
+
}
|
|
592
|
+
function mergeTexts(defaults, customTexts) {
|
|
579
593
|
return {
|
|
580
594
|
export: { ...defaults.export, ...(customTexts?.export ?? {}) },
|
|
581
595
|
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|