mapa-library-ui 2.16.0 → 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.
Files changed (33) hide show
  1. package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs +17 -3
  2. package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs.map +1 -1
  3. package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs +17 -3
  4. package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs.map +1 -1
  5. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +17 -3
  6. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
  7. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs +17 -3
  8. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
  9. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs +17 -3
  10. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
  11. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs +17 -3
  12. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs.map +1 -1
  13. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +17 -3
  14. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
  15. package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs +17 -3
  16. package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs.map +1 -1
  17. package/fesm2022/mapa-library-ui-src-lib-components-input.mjs +17 -3
  18. package/fesm2022/mapa-library-ui-src-lib-components-input.mjs.map +1 -1
  19. package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs +17 -3
  20. package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs.map +1 -1
  21. package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs +17 -3
  22. package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs.map +1 -1
  23. package/fesm2022/mapa-library-ui-src-lib-components-table.mjs +17 -3
  24. package/fesm2022/mapa-library-ui-src-lib-components-table.mjs.map +1 -1
  25. package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs +17 -3
  26. package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs.map +1 -1
  27. package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs +17 -3
  28. package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs.map +1 -1
  29. package/fesm2022/mapa-library-ui.mjs +17 -3
  30. package/fesm2022/mapa-library-ui.mjs.map +1 -1
  31. package/mapa-library-ui-2.17.0.tgz +0 -0
  32. package/package.json +1 -1
  33. package/mapa-library-ui-2.16.0.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
- return DEFAULT_MAPA_UI_TEXTS;
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
- const defaults = getDefaultTexts();
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 ?? {}) },