mapa-library-ui 1.1.8 → 1.2.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 (42) hide show
  1. package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs +13 -95
  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 +13 -95
  4. package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs.map +1 -1
  5. package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs +13 -95
  6. package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs.map +1 -1
  7. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +13 -95
  8. package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
  9. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs +13 -95
  10. package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
  11. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs +13 -95
  12. package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
  13. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs +13 -95
  14. package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs.map +1 -1
  15. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +13 -95
  16. package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
  17. package/fesm2022/mapa-library-ui-src-lib-components-input.mjs +13 -95
  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 +13 -95
  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 +13 -95
  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 +23 -103
  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 +13 -95
  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 +80 -7
  28. package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs.map +1 -1
  29. package/fesm2022/mapa-library-ui.mjs +39 -109
  30. package/fesm2022/mapa-library-ui.mjs.map +1 -1
  31. package/index.d.ts +32 -75
  32. package/mapa-library-ui-1.2.0.tgz +0 -0
  33. package/package.json +10 -8
  34. package/src/lib/components/capability/index.d.ts +11 -65
  35. package/src/lib/components/datepicker-range/index.d.ts +7 -61
  36. package/src/lib/components/dropdown/index.d.ts +7 -61
  37. package/src/lib/components/filters/index.d.ts +8 -62
  38. package/src/lib/components/scale/index.d.ts +8 -62
  39. package/src/lib/components/scale-parameterization/index.d.ts +8 -62
  40. package/src/lib/components/table/index.d.ts +11 -64
  41. package/src/lib/components/warning/index.d.ts +25 -0
  42. package/mapa-library-ui-1.1.8.tgz +0 -0
@@ -4,6 +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 { getMapaUiTexts } from 'mapa-frontend-i18n';
7
8
  import { Md5 } from 'ts-md5';
8
9
  import * as i2 from '@angular/material/expansion';
9
10
  import { MatExpansionModule } from '@angular/material/expansion';
@@ -418,103 +419,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
418
419
  }], ctorParameters: () => [{ type: HtmlSanitizerService }] });
419
420
 
420
421
  const MAPA_UI_TEXTS = new InjectionToken("MAPA_UI_TEXTS");
421
- const MAPA_UI_DEFAULT_TEXTS = {
422
- common: {
423
- selectAll: "Selecionar todos",
424
- },
425
- filters: {
426
- clear: "Limpar filtros",
427
- submit: "Filtrar",
428
- },
429
- datepicker: {
430
- startDatePlaceholder: "Data inicial",
431
- endDatePlaceholder: "Data final",
432
- },
433
- capability: {
434
- groupAverageTitle: "Média geral do grupo",
435
- individualAverageTitle: "Média geral do indivíduo",
436
- conceptTitle: "Conceito",
437
- resultTitle: "Resultado",
438
- positiveIndicatorsTitle: "Indicadores positivos",
439
- negativeIndicatorsTitle: "Indicadores negativos",
440
- riskIndicatorsTitle: "Indicadores de risco",
441
- precipitationRiskTitle: "Risco de acidente por precipitação",
442
- negligenceRiskTitle: "Risco de acidente por negligência",
443
- negativeDirectionLabel: "Direção Negativa |",
444
- positiveDirectionLabel: "Direção Positiva |",
445
- },
446
- paginator: {
447
- itemsPerPage: "Itens por página",
448
- nextPage: "Próxima página",
449
- previousPage: "Página anterior",
450
- rangeLabel: (page, pageSize, length) => {
451
- if (length === 0 || pageSize === 0) {
452
- return `0 de ${length}`;
453
- }
454
- const startIndex = page * pageSize;
455
- const endIndex = startIndex < length
456
- ? Math.min(startIndex + pageSize, length)
457
- : startIndex + pageSize;
458
- return `${startIndex + 1} - ${endIndex} de ${length}`;
459
- },
460
- showingRangeLabel: (page, pageSize, length) => {
461
- if (length === 0) {
462
- return "Mostrando 0 - 0 de 0 item";
463
- }
464
- const startIndex = page * pageSize;
465
- const endIndex = startIndex < length
466
- ? Math.min(startIndex + pageSize, length)
467
- : startIndex + pageSize;
468
- const itemLabel = length === 1 ? "item" : "itens";
469
- return `Mostrando ${startIndex + 1} - ${endIndex} de ${length} ${itemLabel}`;
470
- },
471
- },
472
- table: {
473
- emptyTitle: "Nao foram encontrados resultados",
474
- emptySubtitle: "",
475
- },
476
- validation: {
477
- cnpj: "CNPJ inválido",
478
- cpf: "CPF inválido",
479
- email: "E-mail inválido",
480
- max: (context) => `O valor máximo permitido é ${context?.max ?? ""}`.trim(),
481
- maxLength: (context) => `O máximo permitido é ${context?.requiredLength ?? ""} caracteres`.trim(),
482
- min: (context) => `O valor minimo permitido é ${context?.min ?? ""}`.trim(),
483
- minLength: (context) => `O mínimo permitido é ${context?.requiredLength ?? ""} caracteres`.trim(),
484
- pattern: "Formato inválido",
485
- required: "Campo obrigatório",
486
- },
487
- };
422
+ function getDefaultTexts() {
423
+ return getMapaUiTexts("pt-BR");
424
+ }
488
425
  function mergeMapaUiTexts(customTexts) {
426
+ const defaults = getDefaultTexts();
489
427
  return {
490
- common: {
491
- ...MAPA_UI_DEFAULT_TEXTS.common,
492
- ...(customTexts?.common ?? {}),
493
- },
494
- filters: {
495
- ...MAPA_UI_DEFAULT_TEXTS.filters,
496
- ...(customTexts?.filters ?? {}),
497
- },
498
- datepicker: {
499
- ...MAPA_UI_DEFAULT_TEXTS.datepicker,
500
- ...(customTexts?.datepicker ?? {}),
501
- },
502
- capability: {
503
- ...MAPA_UI_DEFAULT_TEXTS.capability,
504
- ...(customTexts?.capability ?? {}),
505
- },
506
- paginator: {
507
- ...MAPA_UI_DEFAULT_TEXTS.paginator,
508
- ...(customTexts?.paginator ?? {}),
509
- },
510
- table: {
511
- ...MAPA_UI_DEFAULT_TEXTS.table,
512
- ...(customTexts?.table ?? {}),
513
- },
514
- validation: {
515
- ...MAPA_UI_DEFAULT_TEXTS.validation,
516
- ...(customTexts?.validation ?? {}),
517
- },
428
+ common: { ...defaults.common, ...(customTexts?.common ?? {}) },
429
+ filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },
430
+ datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },
431
+ capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },
432
+ paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },
433
+ warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },
434
+ table: { ...defaults.table, ...(customTexts?.table ?? {}) },
435
+ validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },
518
436
  };
519
437
  }
520
438
  function provideMapaUiTexts(texts) {