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.
Files changed (35) hide show
  1. package/README.md +31 -0
  2. package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs +17 -3
  3. package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs.map +1 -1
  4. package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs +17 -3
  5. package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs.map +1 -1
  6. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +17 -3
  7. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
  8. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs +17 -3
  9. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
  10. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs +17 -3
  11. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
  12. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs +17 -3
  13. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs.map +1 -1
  14. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +17 -3
  15. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
  16. package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs +17 -3
  17. package/fesm2022/mapa-library-ui-src-lib-components-group-report.mjs.map +1 -1
  18. package/fesm2022/mapa-library-ui-src-lib-components-input.mjs +17 -3
  19. package/fesm2022/mapa-library-ui-src-lib-components-input.mjs.map +1 -1
  20. package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs +17 -3
  21. package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs.map +1 -1
  22. package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs +17 -3
  23. package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs.map +1 -1
  24. package/fesm2022/mapa-library-ui-src-lib-components-table.mjs +17 -3
  25. package/fesm2022/mapa-library-ui-src-lib-components-table.mjs.map +1 -1
  26. package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs +17 -3
  27. package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs.map +1 -1
  28. package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs +17 -3
  29. package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs.map +1 -1
  30. package/fesm2022/mapa-library-ui.mjs +275 -40
  31. package/fesm2022/mapa-library-ui.mjs.map +1 -1
  32. package/index.d.ts +57 -2
  33. package/mapa-library-ui-2.17.0.tgz +0 -0
  34. package/package.json +1 -1
  35. package/mapa-library-ui-2.15.1.tgz +0 -0
package/README.md CHANGED
@@ -264,6 +264,37 @@ continuam intactos para o **mv-frontend**.
264
264
 
265
265
  ---
266
266
 
267
+ ## Largura das classificações
268
+
269
+ Forneça `MapaClassificationWidthContext` nos `providers` do relatório e importe
270
+ `MapaClassificationWidthGroupDirective` de `mapa-library-ui/classification-tag`.
271
+ Em consumidores com Native Federation, importe esses símbolos pela raiz
272
+ `mapa-library-ui`, compartilhada pelo shell.
273
+ Use a mesma chave nos widgets do mesmo instrumento e informe os nomes das
274
+ classificações disponíveis em `classificationLabels`, incluindo ambas as direções:
275
+
276
+ ```html
277
+ <section mapaClassificationWidthGroup="psychosocial" [classificationLabels]="labels">
278
+ <mapa-report-psychosocial-widget [heading]="heading" [data]="data" />
279
+ </section>
280
+ ```
281
+
282
+ As tags compartilham a largura do maior rótulo da legenda do instrumento, inclusive
283
+ entre seções separadas do relatório. Idioma, fontes e variantes são considerados;
284
+ altura, fonte e cores permanecem próprias de cada variante. Tags isoladas mantêm
285
+ sua largura natural. A legenda também funciona sozinha, com largura comum entre
286
+ suas duas direções.
287
+
288
+ Badges nativos podem participar importando `MapaClassificationWidthItemDirective`,
289
+ usando `[mapaClassificationWidthItem]="[label]"` e aplicando
290
+ `width: var(--mapa-classification-width, auto)` ao badge. Limite-o a `max-width: 100%`
291
+ e permita quebra em containers estreitos. Cada relatório deve ter seu próprio
292
+ contexto; não o forneça globalmente.
293
+
294
+ Somente `classificationLabels` e os itens da própria legenda definem os rótulos
295
+ de referência. Textos de resultados, conclusões e fallbacks ausentes da legenda
296
+ não ampliam as tags. A parametrização usa uma chave própria, separada do instrumento.
297
+
267
298
  ## Desenvolvimento
268
299
 
269
300
  Não há dev server da própria biblioteca. Desenvolve-se através do app de **documentação** (vitrine de
@@ -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
- return DEFAULT_MAPA_UI_TEXTS;
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
- const defaults = getDefaultTexts();
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 ?? {}) },