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
|
@@ -3,7 +3,7 @@ import { CommonModule, NgClass, NgTemplateOutlet, DatePipe } from '@angular/comm
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, inject, Injector, signal, Optional, Inject, Injectable, effect, EventEmitter, DestroyRef, Input, Output, Directive, SecurityContext, Pipe, Component, TemplateRef, contentChildren, ChangeDetectorRef, viewChild, afterEveryRender, ChangeDetectionStrategy } from '@angular/core';
|
|
5
5
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getIntlLocale } from 'mapa-frontend-i18n';
|
|
6
|
+
import { MAPA_UI_TEXTS_PT_BR, getExportUiTexts, getStoredAppLanguage, getMapaUiTexts, getIntlLocale } from 'mapa-frontend-i18n';
|
|
7
7
|
import * as i1 from '@angular/material/paginator';
|
|
8
8
|
import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
|
|
9
9
|
import * as i1$3 from '@angular/material/checkbox';
|
|
@@ -170,11 +170,25 @@ const DEFAULT_MAPA_UI_TEXTS = {
|
|
|
170
170
|
launchOptions: MAPA_UI_TEXTS_PT_BR.launchOptions,
|
|
171
171
|
fileDrop: MAPA_UI_TEXTS_PT_BR.fileDrop,
|
|
172
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
* Padrão dos textos: pt-BR, ou o idioma salvo pelo app (`menu.language`).
|
|
175
|
+
*
|
|
176
|
+
* Cada entry point da lib (table, dropdown, chart…) é empacotado com a própria cópia
|
|
177
|
+
* deste módulo — e do `MapaI18nService` —, então o `provideMapaUiTexts`/`setTexts` do app
|
|
178
|
+
* nem sempre chega nele. Sem isso, componentes como a paginação da `mapa-table` ficavam em
|
|
179
|
+
* pt-BR mesmo com o app em en/es. Textos passados pelo app continuam vencendo o padrão.
|
|
180
|
+
*/
|
|
173
181
|
function getDefaultTexts() {
|
|
174
|
-
|
|
182
|
+
const language = getStoredAppLanguage();
|
|
183
|
+
if (language === 'pt-BR') {
|
|
184
|
+
return DEFAULT_MAPA_UI_TEXTS;
|
|
185
|
+
}
|
|
186
|
+
return mergeTexts(DEFAULT_MAPA_UI_TEXTS, getMapaUiTexts(language));
|
|
175
187
|
}
|
|
176
188
|
function mergeMapaUiTexts(customTexts) {
|
|
177
|
-
|
|
189
|
+
return mergeTexts(getDefaultTexts(), customTexts);
|
|
190
|
+
}
|
|
191
|
+
function mergeTexts(defaults, customTexts) {
|
|
178
192
|
return {
|
|
179
193
|
export: { ...defaults.export, ...(customTexts?.export ?? {}) },
|
|
180
194
|
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|