mapa-library-ui 1.1.7 → 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.
- package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-capability.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-chart.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-filters.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-input.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-input.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-scale-parameterization.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-scale.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs +23 -103
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs +13 -95
- package/fesm2022/mapa-library-ui-src-lib-components-textarea.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs +80 -7
- package/fesm2022/mapa-library-ui-src-lib-components-warning.mjs.map +1 -1
- package/fesm2022/mapa-library-ui.mjs +39 -109
- package/fesm2022/mapa-library-ui.mjs.map +1 -1
- package/index.d.ts +32 -75
- package/mapa-library-ui-1.2.0.tgz +0 -0
- package/package.json +10 -8
- package/src/lib/components/capability/index.d.ts +11 -65
- package/src/lib/components/datepicker-range/index.d.ts +7 -61
- package/src/lib/components/dropdown/index.d.ts +7 -61
- package/src/lib/components/filters/index.d.ts +8 -62
- package/src/lib/components/scale/index.d.ts +8 -62
- package/src/lib/components/scale-parameterization/index.d.ts +8 -62
- package/src/lib/components/table/index.d.ts +11 -64
- package/src/lib/components/warning/index.d.ts +25 -0
- package/mapa-library-ui-1.1.7.tgz +0 -0
|
@@ -9,106 +9,24 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
9
9
|
import * as i4 from '@angular/material/input';
|
|
10
10
|
import { MatInputModule } from '@angular/material/input';
|
|
11
11
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
12
|
+
import { getMapaUiTexts } from 'mapa-frontend-i18n';
|
|
12
13
|
import * as i5 from '@angular/cdk/text-field';
|
|
13
14
|
|
|
14
15
|
const MAPA_UI_TEXTS = new InjectionToken("MAPA_UI_TEXTS");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
filters: {
|
|
20
|
-
clear: "Limpar filtros",
|
|
21
|
-
submit: "Filtrar",
|
|
22
|
-
},
|
|
23
|
-
datepicker: {
|
|
24
|
-
startDatePlaceholder: "Data inicial",
|
|
25
|
-
endDatePlaceholder: "Data final",
|
|
26
|
-
},
|
|
27
|
-
capability: {
|
|
28
|
-
groupAverageTitle: "Média geral do grupo",
|
|
29
|
-
individualAverageTitle: "Média geral do indivíduo",
|
|
30
|
-
conceptTitle: "Conceito",
|
|
31
|
-
resultTitle: "Resultado",
|
|
32
|
-
positiveIndicatorsTitle: "Indicadores positivos",
|
|
33
|
-
negativeIndicatorsTitle: "Indicadores negativos",
|
|
34
|
-
riskIndicatorsTitle: "Indicadores de risco",
|
|
35
|
-
precipitationRiskTitle: "Risco de acidente por precipitação",
|
|
36
|
-
negligenceRiskTitle: "Risco de acidente por negligência",
|
|
37
|
-
negativeDirectionLabel: "Direção Negativa |",
|
|
38
|
-
positiveDirectionLabel: "Direção Positiva |",
|
|
39
|
-
},
|
|
40
|
-
paginator: {
|
|
41
|
-
itemsPerPage: "Itens por página",
|
|
42
|
-
nextPage: "Próxima página",
|
|
43
|
-
previousPage: "Página anterior",
|
|
44
|
-
rangeLabel: (page, pageSize, length) => {
|
|
45
|
-
if (length === 0 || pageSize === 0) {
|
|
46
|
-
return `0 de ${length}`;
|
|
47
|
-
}
|
|
48
|
-
const startIndex = page * pageSize;
|
|
49
|
-
const endIndex = startIndex < length
|
|
50
|
-
? Math.min(startIndex + pageSize, length)
|
|
51
|
-
: startIndex + pageSize;
|
|
52
|
-
return `${startIndex + 1} - ${endIndex} de ${length}`;
|
|
53
|
-
},
|
|
54
|
-
showingRangeLabel: (page, pageSize, length) => {
|
|
55
|
-
if (length === 0) {
|
|
56
|
-
return "Mostrando 0 - 0 de 0 item";
|
|
57
|
-
}
|
|
58
|
-
const startIndex = page * pageSize;
|
|
59
|
-
const endIndex = startIndex < length
|
|
60
|
-
? Math.min(startIndex + pageSize, length)
|
|
61
|
-
: startIndex + pageSize;
|
|
62
|
-
const itemLabel = length === 1 ? "item" : "itens";
|
|
63
|
-
return `Mostrando ${startIndex + 1} - ${endIndex} de ${length} ${itemLabel}`;
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
table: {
|
|
67
|
-
emptyTitle: "Nao foram encontrados resultados",
|
|
68
|
-
emptySubtitle: "",
|
|
69
|
-
},
|
|
70
|
-
validation: {
|
|
71
|
-
cnpj: "CNPJ inválido",
|
|
72
|
-
cpf: "CPF inválido",
|
|
73
|
-
email: "E-mail inválido",
|
|
74
|
-
max: (context) => `O valor máximo permitido é ${context?.max ?? ""}`.trim(),
|
|
75
|
-
maxLength: (context) => `O máximo permitido é ${context?.requiredLength ?? ""} caracteres`.trim(),
|
|
76
|
-
min: (context) => `O valor minimo permitido é ${context?.min ?? ""}`.trim(),
|
|
77
|
-
minLength: (context) => `O mínimo permitido é ${context?.requiredLength ?? ""} caracteres`.trim(),
|
|
78
|
-
pattern: "Formato inválido",
|
|
79
|
-
required: "Campo obrigatório",
|
|
80
|
-
},
|
|
81
|
-
};
|
|
16
|
+
function getDefaultTexts() {
|
|
17
|
+
return getMapaUiTexts("pt-BR");
|
|
18
|
+
}
|
|
82
19
|
function mergeMapaUiTexts(customTexts) {
|
|
20
|
+
const defaults = getDefaultTexts();
|
|
83
21
|
return {
|
|
84
|
-
common: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
datepicker: {
|
|
93
|
-
...MAPA_UI_DEFAULT_TEXTS.datepicker,
|
|
94
|
-
...(customTexts?.datepicker ?? {}),
|
|
95
|
-
},
|
|
96
|
-
capability: {
|
|
97
|
-
...MAPA_UI_DEFAULT_TEXTS.capability,
|
|
98
|
-
...(customTexts?.capability ?? {}),
|
|
99
|
-
},
|
|
100
|
-
paginator: {
|
|
101
|
-
...MAPA_UI_DEFAULT_TEXTS.paginator,
|
|
102
|
-
...(customTexts?.paginator ?? {}),
|
|
103
|
-
},
|
|
104
|
-
table: {
|
|
105
|
-
...MAPA_UI_DEFAULT_TEXTS.table,
|
|
106
|
-
...(customTexts?.table ?? {}),
|
|
107
|
-
},
|
|
108
|
-
validation: {
|
|
109
|
-
...MAPA_UI_DEFAULT_TEXTS.validation,
|
|
110
|
-
...(customTexts?.validation ?? {}),
|
|
111
|
-
},
|
|
22
|
+
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|
|
23
|
+
filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },
|
|
24
|
+
datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },
|
|
25
|
+
capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },
|
|
26
|
+
paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },
|
|
27
|
+
warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },
|
|
28
|
+
table: { ...defaults.table, ...(customTexts?.table ?? {}) },
|
|
29
|
+
validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },
|
|
112
30
|
};
|
|
113
31
|
}
|
|
114
32
|
function provideMapaUiTexts(texts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapa-library-ui-src-lib-components-textarea.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/i18n/mapa-ui-texts.ts","../../../projects/mapa-library-ui/src/lib/core/services/mapa-i18n.service.ts","../../../projects/mapa-library-ui/src/lib/core/services/validation-message-resolver.service.ts","../../../projects/mapa-library-ui/src/lib/core/components/form-errors/form-errors.component.ts","../../../projects/mapa-library-ui/src/lib/core/components/form-errors/form-errors.component.html","../../../projects/mapa-library-ui/src/lib/components/textarea/src/textarea.component.ts","../../../projects/mapa-library-ui/src/lib/components/textarea/src/textarea.component.html","../../../projects/mapa-library-ui/src/lib/components/textarea/public-api.ts","../../../projects/mapa-library-ui/src/textarea.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-textarea.ts"],"sourcesContent":["import { InjectionToken, Provider } from \"@angular/core\";\n\nexport interface ValidationMessageContext {\n actualLength?: number;\n max?: number;\n min?: number;\n requiredLength?: number;\n}\n\nexport type ValidationTextResolver =\n | string\n | ((context?: ValidationMessageContext) => string);\n\nexport interface MapaUiTexts {\n common: {\n selectAll: string;\n };\n filters: {\n clear: string;\n submit: string;\n };\n datepicker: {\n startDatePlaceholder: string;\n endDatePlaceholder: string;\n };\n capability: {\n groupAverageTitle: string;\n individualAverageTitle: string;\n conceptTitle: string;\n resultTitle: string;\n positiveIndicatorsTitle: string;\n negativeIndicatorsTitle: string;\n riskIndicatorsTitle: string;\n precipitationRiskTitle: string;\n negligenceRiskTitle: string;\n negativeDirectionLabel: string;\n positiveDirectionLabel: string;\n };\n paginator: {\n itemsPerPage: string;\n nextPage: string;\n previousPage: string;\n rangeLabel: (page: number, pageSize: number, length: number) => string;\n showingRangeLabel: (\n page: number,\n pageSize: number,\n length: number\n ) => string;\n };\n table: {\n emptyTitle: string;\n emptySubtitle: string;\n };\n validation: {\n cnpj: ValidationTextResolver;\n cpf: ValidationTextResolver;\n email: ValidationTextResolver;\n max: ValidationTextResolver;\n maxLength: ValidationTextResolver;\n min: ValidationTextResolver;\n minLength: ValidationTextResolver;\n pattern: ValidationTextResolver;\n required: ValidationTextResolver;\n };\n}\n\nexport type PartialMapaUiTexts = Partial<{\n [K in keyof MapaUiTexts]: Partial<MapaUiTexts[K]>;\n}>;\n\nexport const MAPA_UI_TEXTS = new InjectionToken<PartialMapaUiTexts>(\n \"MAPA_UI_TEXTS\"\n);\n\nexport const MAPA_UI_DEFAULT_TEXTS: MapaUiTexts = {\n common: {\n selectAll: \"Selecionar todos\",\n },\n filters: {\n clear: \"Limpar filtros\",\n submit: \"Filtrar\",\n },\n datepicker: {\n startDatePlaceholder: \"Data inicial\",\n endDatePlaceholder: \"Data final\",\n },\n capability: {\n groupAverageTitle: \"Média geral do grupo\",\n individualAverageTitle: \"Média geral do indivíduo\",\n conceptTitle: \"Conceito\",\n resultTitle: \"Resultado\",\n positiveIndicatorsTitle: \"Indicadores positivos\",\n negativeIndicatorsTitle: \"Indicadores negativos\",\n riskIndicatorsTitle: \"Indicadores de risco\",\n precipitationRiskTitle: \"Risco de acidente por precipitação\",\n negligenceRiskTitle: \"Risco de acidente por negligência\",\n negativeDirectionLabel: \"Direção Negativa |\",\n positiveDirectionLabel: \"Direção Positiva |\",\n },\n paginator: {\n itemsPerPage: \"Itens por página\",\n nextPage: \"Próxima página\",\n previousPage: \"Página anterior\",\n rangeLabel: (page: number, pageSize: number, length: number) => {\n if (length === 0 || pageSize === 0) {\n return `0 de ${length}`;\n }\n\n const startIndex = page * pageSize;\n const endIndex =\n startIndex < length\n ? Math.min(startIndex + pageSize, length)\n : startIndex + pageSize;\n\n return `${startIndex + 1} - ${endIndex} de ${length}`;\n },\n showingRangeLabel: (page: number, pageSize: number, length: number) => {\n if (length === 0) {\n return \"Mostrando 0 - 0 de 0 item\";\n }\n\n const startIndex = page * pageSize;\n const endIndex =\n startIndex < length\n ? Math.min(startIndex + pageSize, length)\n : startIndex + pageSize;\n const itemLabel = length === 1 ? \"item\" : \"itens\";\n\n return `Mostrando ${startIndex + 1} - ${endIndex} de ${length} ${itemLabel}`;\n },\n },\n table: {\n emptyTitle: \"Nao foram encontrados resultados\",\n emptySubtitle: \"\",\n },\n validation: {\n cnpj: \"CNPJ inválido\",\n cpf: \"CPF inválido\",\n email: \"E-mail inválido\",\n max: (context?: ValidationMessageContext) =>\n `O valor máximo permitido é ${context?.max ?? \"\"}`.trim(),\n maxLength: (context?: ValidationMessageContext) =>\n `O máximo permitido é ${context?.requiredLength ?? \"\"} caracteres`.trim(),\n min: (context?: ValidationMessageContext) =>\n `O valor minimo permitido é ${context?.min ?? \"\"}`.trim(),\n minLength: (context?: ValidationMessageContext) =>\n `O mínimo permitido é ${context?.requiredLength ?? \"\"} caracteres`.trim(),\n pattern: \"Formato inválido\",\n required: \"Campo obrigatório\",\n },\n};\n\nexport function mergeMapaUiTexts(\n customTexts?: PartialMapaUiTexts | null\n): MapaUiTexts {\n return {\n common: {\n ...MAPA_UI_DEFAULT_TEXTS.common,\n ...(customTexts?.common ?? {}),\n },\n filters: {\n ...MAPA_UI_DEFAULT_TEXTS.filters,\n ...(customTexts?.filters ?? {}),\n },\n datepicker: {\n ...MAPA_UI_DEFAULT_TEXTS.datepicker,\n ...(customTexts?.datepicker ?? {}),\n },\n capability: {\n ...MAPA_UI_DEFAULT_TEXTS.capability,\n ...(customTexts?.capability ?? {}),\n },\n paginator: {\n ...MAPA_UI_DEFAULT_TEXTS.paginator,\n ...(customTexts?.paginator ?? {}),\n },\n table: {\n ...MAPA_UI_DEFAULT_TEXTS.table,\n ...(customTexts?.table ?? {}),\n },\n validation: {\n ...MAPA_UI_DEFAULT_TEXTS.validation,\n ...(customTexts?.validation ?? {}),\n },\n };\n}\n\nexport function provideMapaUiTexts(texts: PartialMapaUiTexts): Provider {\n return {\n provide: MAPA_UI_TEXTS,\n useValue: texts,\n };\n}\n","import { Inject, Injectable, Injector, Optional, inject, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport {\n MAPA_UI_TEXTS,\n MapaUiTexts,\n PartialMapaUiTexts,\n ValidationMessageContext,\n ValidationTextResolver,\n mergeMapaUiTexts,\n} from \"../i18n/mapa-ui-texts\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MapaI18nService {\n private readonly injector = inject(Injector);\n private readonly textsState = signal<MapaUiTexts>(mergeMapaUiTexts());\n\n readonly textsSignal = this.textsState.asReadonly();\n readonly texts$ = toObservable(this.textsSignal, { injector: this.injector });\n\n constructor(\n @Optional() @Inject(MAPA_UI_TEXTS) customTexts: PartialMapaUiTexts | null\n ) {\n if (customTexts) {\n this.textsState.set(mergeMapaUiTexts(customTexts));\n }\n }\n\n get texts(): MapaUiTexts {\n return this.textsState();\n }\n\n setTexts(texts: PartialMapaUiTexts): void {\n this.textsState.set(mergeMapaUiTexts(texts));\n }\n\n resolveValidationText(\n key: keyof MapaUiTexts[\"validation\"],\n context?: ValidationMessageContext\n ): string {\n return this.resolveText(this.texts.validation[key], context);\n }\n\n private resolveText(\n value: ValidationTextResolver,\n context?: ValidationMessageContext\n ): string {\n return typeof value === \"function\" ? value(context) : value;\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport { AbstractControl, ValidationErrors } from \"@angular/forms\";\nimport { Errors } from \"../elements/errors\";\nimport { MapaI18nService } from \"./mapa-i18n.service\";\n\ntype ValidationKey =\n | \"required\"\n | \"minlength\"\n | \"maxlength\"\n | \"cpf\"\n | \"cnpj\"\n | \"email\"\n | \"pattern\"\n | \"min\"\n | \"max\";\n\ntype ErrorOverrides = Errors & {\n maxlength?: string;\n minlength?: string;\n};\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class ValidationMessageResolverService {\n private readonly errorOrder: ValidationKey[] = [\n \"required\",\n \"minlength\",\n \"maxlength\",\n \"cpf\",\n \"cnpj\",\n \"email\",\n \"pattern\",\n \"min\",\n \"max\",\n ];\n\n constructor(private readonly i18n: MapaI18nService) {}\n\n resolveFirstError(\n control?: AbstractControl | null,\n errors?: Errors\n ): string | null {\n const validationErrors = control?.errors;\n\n if (!validationErrors) {\n return null;\n }\n\n const firstErrorKey = this.errorOrder.find((key) => control?.hasError(key));\n\n if (!firstErrorKey) {\n return null;\n }\n\n return this.resolveErrorMessage(firstErrorKey, validationErrors, errors);\n }\n\n private resolveErrorMessage(\n errorKey: ValidationKey,\n validationErrors: ValidationErrors,\n errors?: Errors\n ): string {\n const errorOverrides = errors as ErrorOverrides | undefined;\n const customMessage = this.getCustomMessage(errorKey, errorOverrides);\n\n if (customMessage) {\n return customMessage;\n }\n\n const errorValue = validationErrors[errorKey];\n\n switch (errorKey) {\n case \"minlength\":\n return this.i18n.resolveValidationText(\"minLength\", errorValue);\n case \"maxlength\":\n return this.i18n.resolveValidationText(\"maxLength\", errorValue);\n case \"min\":\n return this.i18n.resolveValidationText(\"min\", errorValue);\n case \"max\":\n return this.i18n.resolveValidationText(\"max\", errorValue);\n default:\n return this.i18n.resolveValidationText(errorKey);\n }\n }\n\n private getCustomMessage(\n errorKey: ValidationKey,\n errors?: ErrorOverrides\n ): string | undefined {\n if (!errors) {\n return undefined;\n }\n\n switch (errorKey) {\n case \"minlength\":\n return errors.minLength ?? errors.minlength;\n case \"maxlength\":\n return errors.maxLength ?? errors.maxlength;\n default:\n return errors[errorKey];\n }\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { Component, Input } from \"@angular/core\";\nimport { AbstractControl } from \"@angular/forms\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { Errors } from \"../../elements/errors\";\nimport { ValidationMessageResolverService } from \"../../services/validation-message-resolver.service\";\n\n@Component({\n selector: \"mapa-form-errors\",\n imports: [CommonModule, MatFormFieldModule],\n templateUrl: \"./form-errors.component.html\"\n})\nexport class MapaFormErrorsComponent {\n @Input() control?: AbstractControl | null;\n @Input() errors?: Errors;\n\n constructor(\n private readonly validationMessageResolver: ValidationMessageResolverService\n ) {}\n\n get message(): string | null {\n return this.validationMessageResolver.resolveFirstError(\n this.control,\n this.errors\n );\n }\n}\n","<span *ngIf=\"message\">\n {{ message }}\n</span>\n","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { FormsModule, FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MapaFormErrorsComponent } from '../../../core/components/form-errors/form-errors.component';\nimport { Textarea } from '../../../core/elements/textarea';\n\n@Component({\n selector: 'mapa-textarea',\n templateUrl: './textarea.component.html',\n styleUrl: './textarea.component.scss',\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MapaFormErrorsComponent,\n ],\n standalone: true\n})\nexport class MapaTextareaComponent {\n @Input() formControl!: FormControl;\n @Input() element!: Textarea;\n\n}\n\n","<label *ngIf=\"element.label\" class=\"mapa-textarea__label\">\n {{ element.label }}\n</label>\n<mat-form-field\n class=\"mapa-textarea\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <textarea\n *ngIf=\"element.autosize\"\n class=\"mapa-textarea__control mapa-textarea__control--autosize\"\n matInput\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n [cdkAutosizeMinRows]=\"element.autosizeMinRow\"\n [cdkAutosizeMaxRows]=\"element.autosizeMaxRow\"\n [formControl]=\"formControl\"\n [placeholder]=\"element.placeholder || ''\"\n ></textarea>\n <textarea\n class=\"mapa-textarea__control mapa-textarea__control--manual\"\n matInput\n *ngIf=\"!element.autosize\"\n [maxlength]=\"element.maxLength\"\n [formControl]=\"formControl\"\n [placeholder]=\"element.placeholder || ''\"\n ></textarea>\n <mat-hint *ngIf=\"element.hint\">{{ element.hint }}</mat-hint>\n <mat-error>\n <mapa-form-errors\n [control]=\"formControl\"\n [errors]=\"element.errors\"\n ></mapa-form-errors>\n </mat-error>\n</mat-form-field>\n","/*\n * Public API Surface of mapa-library-ui textarea\n */\n\nexport * from './src/textarea.component';\n","/*\n * Public API Surface of mapa-library-ui textarea\n */\n\nexport * from './lib/components/textarea/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './textarea';\n"],"names":["i1.MapaI18nService","i1.ValidationMessageResolverService","i1","i2"],"mappings":";;;;;;;;;;;;;AAsEO,MAAM,aAAa,GAAG,IAAI,cAAc,CAC7C,eAAe,CAChB;AAEM,MAAM,qBAAqB,GAAgB;AAChD,IAAA,MAAM,EAAE;AACN,QAAA,SAAS,EAAE,kBAAkB;AAC9B,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,MAAM,EAAE,SAAS;AAClB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,oBAAoB,EAAE,cAAc;AACpC,QAAA,kBAAkB,EAAE,YAAY;AACjC,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,iBAAiB,EAAE,sBAAsB;AACzC,QAAA,sBAAsB,EAAE,0BAA0B;AAClD,QAAA,YAAY,EAAE,UAAU;AACxB,QAAA,WAAW,EAAE,WAAW;AACxB,QAAA,uBAAuB,EAAE,uBAAuB;AAChD,QAAA,uBAAuB,EAAE,uBAAuB;AAChD,QAAA,mBAAmB,EA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EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAClB,cAAc,imBACd,uBAAuB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIhB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAdjC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAGhB;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,uBAAuB;AACxB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,glCAAA,EAAA,MAAA,EAAA,CAAA,gqDAAA,CAAA,EAAA;;sBAGjB;;sBACA;;;AExBH;;AAEG;;ACFH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-components-textarea.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/i18n/mapa-ui-texts.ts","../../../projects/mapa-library-ui/src/lib/core/services/mapa-i18n.service.ts","../../../projects/mapa-library-ui/src/lib/core/services/validation-message-resolver.service.ts","../../../projects/mapa-library-ui/src/lib/core/components/form-errors/form-errors.component.ts","../../../projects/mapa-library-ui/src/lib/core/components/form-errors/form-errors.component.html","../../../projects/mapa-library-ui/src/lib/components/textarea/src/textarea.component.ts","../../../projects/mapa-library-ui/src/lib/components/textarea/src/textarea.component.html","../../../projects/mapa-library-ui/src/lib/components/textarea/public-api.ts","../../../projects/mapa-library-ui/src/textarea.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-textarea.ts"],"sourcesContent":["import { InjectionToken, Provider } from \"@angular/core\";\nimport {\n MapaUiTextGroups,\n PartialMapaUiTexts,\n ValidationContext,\n ValidationTextResolver,\n getMapaUiTexts,\n} from \"mapa-frontend-i18n\";\n\nexport type MapaUiTexts = MapaUiTextGroups;\nexport type ValidationMessageContext = ValidationContext;\nexport type { PartialMapaUiTexts, ValidationTextResolver };\n\nexport const MAPA_UI_TEXTS = new InjectionToken<PartialMapaUiTexts>(\n \"MAPA_UI_TEXTS\"\n);\n\nfunction getDefaultTexts(): MapaUiTexts {\n return getMapaUiTexts(\"pt-BR\") as MapaUiTexts;\n}\n\nexport function mergeMapaUiTexts(\n customTexts?: PartialMapaUiTexts | null\n): MapaUiTexts {\n const defaults = getDefaultTexts();\n\n return {\n common: { ...defaults.common, ...(customTexts?.common ?? {}) },\n filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },\n datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },\n capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },\n paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },\n warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },\n table: { ...defaults.table, ...(customTexts?.table ?? {}) },\n validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },\n };\n}\n\nexport function provideMapaUiTexts(texts: PartialMapaUiTexts): Provider {\n return {\n provide: MAPA_UI_TEXTS,\n useValue: texts,\n };\n}\n","import { Inject, Injectable, Injector, Optional, inject, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport {\n MAPA_UI_TEXTS,\n MapaUiTexts,\n PartialMapaUiTexts,\n ValidationMessageContext,\n ValidationTextResolver,\n mergeMapaUiTexts,\n} from \"../i18n/mapa-ui-texts\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MapaI18nService {\n private readonly injector = inject(Injector);\n private readonly textsState = signal<MapaUiTexts>(mergeMapaUiTexts());\n\n readonly textsSignal = this.textsState.asReadonly();\n readonly texts$ = toObservable(this.textsSignal, { injector: this.injector });\n\n constructor(\n @Optional() @Inject(MAPA_UI_TEXTS) customTexts: PartialMapaUiTexts | null\n ) {\n if (customTexts) {\n this.textsState.set(mergeMapaUiTexts(customTexts));\n }\n }\n\n get texts(): MapaUiTexts {\n return this.textsState();\n }\n\n setTexts(texts: PartialMapaUiTexts): void {\n this.textsState.set(mergeMapaUiTexts(texts));\n }\n\n resolveValidationText(\n key: keyof MapaUiTexts[\"validation\"],\n context?: ValidationMessageContext\n ): string {\n return this.resolveText(this.texts.validation[key], context);\n }\n\n private resolveText(\n value: ValidationTextResolver,\n context?: ValidationMessageContext\n ): string {\n return typeof value === \"function\" ? value(context) : value;\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport { AbstractControl, ValidationErrors } from \"@angular/forms\";\nimport { Errors } from \"../elements/errors\";\nimport { MapaI18nService } from \"./mapa-i18n.service\";\n\ntype ValidationKey =\n | \"required\"\n | \"minlength\"\n | \"maxlength\"\n | \"cpf\"\n | \"cnpj\"\n | \"email\"\n | \"pattern\"\n | \"min\"\n | \"max\";\n\ntype ErrorOverrides = Errors & {\n maxlength?: string;\n minlength?: string;\n};\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class ValidationMessageResolverService {\n private readonly errorOrder: ValidationKey[] = [\n \"required\",\n \"minlength\",\n \"maxlength\",\n \"cpf\",\n \"cnpj\",\n \"email\",\n \"pattern\",\n \"min\",\n \"max\",\n ];\n\n constructor(private readonly i18n: MapaI18nService) {}\n\n resolveFirstError(\n control?: AbstractControl | null,\n errors?: Errors\n ): string | null {\n const validationErrors = control?.errors;\n\n if (!validationErrors) {\n return null;\n }\n\n const firstErrorKey = this.errorOrder.find((key) => control?.hasError(key));\n\n if (!firstErrorKey) {\n return null;\n }\n\n return this.resolveErrorMessage(firstErrorKey, validationErrors, errors);\n }\n\n private resolveErrorMessage(\n errorKey: ValidationKey,\n validationErrors: ValidationErrors,\n errors?: Errors\n ): string {\n const errorOverrides = errors as ErrorOverrides | undefined;\n const customMessage = this.getCustomMessage(errorKey, errorOverrides);\n\n if (customMessage) {\n return customMessage;\n }\n\n const errorValue = validationErrors[errorKey];\n\n switch (errorKey) {\n case \"minlength\":\n return this.i18n.resolveValidationText(\"minLength\", errorValue);\n case \"maxlength\":\n return this.i18n.resolveValidationText(\"maxLength\", errorValue);\n case \"min\":\n return this.i18n.resolveValidationText(\"min\", errorValue);\n case \"max\":\n return this.i18n.resolveValidationText(\"max\", errorValue);\n default:\n return this.i18n.resolveValidationText(errorKey);\n }\n }\n\n private getCustomMessage(\n errorKey: ValidationKey,\n errors?: ErrorOverrides\n ): string | undefined {\n if (!errors) {\n return undefined;\n }\n\n switch (errorKey) {\n case \"minlength\":\n return errors.minLength ?? errors.minlength;\n case \"maxlength\":\n return errors.maxLength ?? errors.maxlength;\n default:\n return errors[errorKey];\n }\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { Component, Input } from \"@angular/core\";\nimport { AbstractControl } from \"@angular/forms\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { Errors } from \"../../elements/errors\";\nimport { ValidationMessageResolverService } from \"../../services/validation-message-resolver.service\";\n\n@Component({\n selector: \"mapa-form-errors\",\n imports: [CommonModule, MatFormFieldModule],\n templateUrl: \"./form-errors.component.html\"\n})\nexport class MapaFormErrorsComponent {\n @Input() control?: AbstractControl | null;\n @Input() errors?: Errors;\n\n constructor(\n private readonly validationMessageResolver: ValidationMessageResolverService\n ) {}\n\n get message(): string | null {\n return this.validationMessageResolver.resolveFirstError(\n this.control,\n this.errors\n );\n }\n}\n","<span *ngIf=\"message\">\n {{ message }}\n</span>\n","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { FormsModule, FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MapaFormErrorsComponent } from '../../../core/components/form-errors/form-errors.component';\nimport { Textarea } from '../../../core/elements/textarea';\n\n@Component({\n selector: 'mapa-textarea',\n templateUrl: './textarea.component.html',\n styleUrl: './textarea.component.scss',\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MapaFormErrorsComponent,\n ],\n standalone: true\n})\nexport class MapaTextareaComponent {\n @Input() formControl!: FormControl;\n @Input() element!: Textarea;\n\n}\n\n","<label *ngIf=\"element.label\" class=\"mapa-textarea__label\">\n {{ element.label }}\n</label>\n<mat-form-field\n class=\"mapa-textarea\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <textarea\n *ngIf=\"element.autosize\"\n class=\"mapa-textarea__control mapa-textarea__control--autosize\"\n matInput\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n [cdkAutosizeMinRows]=\"element.autosizeMinRow\"\n [cdkAutosizeMaxRows]=\"element.autosizeMaxRow\"\n [formControl]=\"formControl\"\n [placeholder]=\"element.placeholder || ''\"\n ></textarea>\n <textarea\n class=\"mapa-textarea__control mapa-textarea__control--manual\"\n matInput\n *ngIf=\"!element.autosize\"\n [maxlength]=\"element.maxLength\"\n [formControl]=\"formControl\"\n [placeholder]=\"element.placeholder || ''\"\n ></textarea>\n <mat-hint *ngIf=\"element.hint\">{{ element.hint }}</mat-hint>\n <mat-error>\n <mapa-form-errors\n [control]=\"formControl\"\n [errors]=\"element.errors\"\n ></mapa-form-errors>\n </mat-error>\n</mat-form-field>\n","/*\n * Public API Surface of mapa-library-ui textarea\n */\n\nexport * from './src/textarea.component';\n","/*\n * Public API Surface of mapa-library-ui textarea\n */\n\nexport * from './lib/components/textarea/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './textarea';\n"],"names":["i1.MapaI18nService","i1.ValidationMessageResolverService","i1","i2"],"mappings":";;;;;;;;;;;;;;AAaO,MAAM,aA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EAAA,MAAA,EAAA,CAAA,gqDAAA,CAAA,EAAA;;sBAGjB;;sBACA;;;AExBH;;AAEG;;ACFH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,16 +1,89 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Input, Component } from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, Injector, signal, Optional, Inject, Injectable, Input, Component } from '@angular/core';
|
|
5
|
+
import { toObservable } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { getMapaUiTexts } from 'mapa-frontend-i18n';
|
|
7
|
+
|
|
8
|
+
const MAPA_UI_TEXTS = new InjectionToken("MAPA_UI_TEXTS");
|
|
9
|
+
function getDefaultTexts() {
|
|
10
|
+
return getMapaUiTexts("pt-BR");
|
|
11
|
+
}
|
|
12
|
+
function mergeMapaUiTexts(customTexts) {
|
|
13
|
+
const defaults = getDefaultTexts();
|
|
14
|
+
return {
|
|
15
|
+
common: { ...defaults.common, ...(customTexts?.common ?? {}) },
|
|
16
|
+
filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },
|
|
17
|
+
datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },
|
|
18
|
+
capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },
|
|
19
|
+
paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },
|
|
20
|
+
warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },
|
|
21
|
+
table: { ...defaults.table, ...(customTexts?.table ?? {}) },
|
|
22
|
+
validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function provideMapaUiTexts(texts) {
|
|
26
|
+
return {
|
|
27
|
+
provide: MAPA_UI_TEXTS,
|
|
28
|
+
useValue: texts,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
class MapaI18nService {
|
|
33
|
+
constructor(customTexts) {
|
|
34
|
+
this.injector = inject(Injector);
|
|
35
|
+
this.textsState = signal(mergeMapaUiTexts(), ...(ngDevMode ? [{ debugName: "textsState" }] : []));
|
|
36
|
+
this.textsSignal = this.textsState.asReadonly();
|
|
37
|
+
this.texts$ = toObservable(this.textsSignal, { injector: this.injector });
|
|
38
|
+
if (customTexts) {
|
|
39
|
+
this.textsState.set(mergeMapaUiTexts(customTexts));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
get texts() {
|
|
43
|
+
return this.textsState();
|
|
44
|
+
}
|
|
45
|
+
setTexts(texts) {
|
|
46
|
+
this.textsState.set(mergeMapaUiTexts(texts));
|
|
47
|
+
}
|
|
48
|
+
resolveValidationText(key, context) {
|
|
49
|
+
return this.resolveText(this.texts.validation[key], context);
|
|
50
|
+
}
|
|
51
|
+
resolveText(value, context) {
|
|
52
|
+
return typeof value === "function" ? value(context) : value;
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaI18nService, deps: [{ token: MAPA_UI_TEXTS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaI18nService, providedIn: "root" }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaI18nService, decorators: [{
|
|
58
|
+
type: Injectable,
|
|
59
|
+
args: [{
|
|
60
|
+
providedIn: "root",
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
63
|
+
type: Optional
|
|
64
|
+
}, {
|
|
65
|
+
type: Inject,
|
|
66
|
+
args: [MAPA_UI_TEXTS]
|
|
67
|
+
}] }] });
|
|
5
68
|
|
|
6
69
|
class MapaWarningComponent {
|
|
7
|
-
constructor() {
|
|
70
|
+
constructor(i18n) {
|
|
71
|
+
this.i18n = i18n;
|
|
8
72
|
this.lowReliabilityReports = [];
|
|
9
73
|
this.showFirstLine = false;
|
|
10
74
|
this.showSecondLine = false;
|
|
11
75
|
this.expirationDateReports = [];
|
|
12
76
|
this.nonExpirationDateReports = [];
|
|
13
77
|
}
|
|
78
|
+
get texts() {
|
|
79
|
+
return this.i18n.textsSignal();
|
|
80
|
+
}
|
|
81
|
+
get lowReliabilityTitle() {
|
|
82
|
+
return this.texts.warning.lowReliabilityTitle;
|
|
83
|
+
}
|
|
84
|
+
get expirationLimitTitle() {
|
|
85
|
+
return this.texts.warning.expirationLimitTitle;
|
|
86
|
+
}
|
|
14
87
|
ngOnInit() {
|
|
15
88
|
this.updateVisibilityFlags();
|
|
16
89
|
this.generateReportArrays();
|
|
@@ -33,13 +106,13 @@ class MapaWarningComponent {
|
|
|
33
106
|
.filter((report) => !report.isExpirationDate)
|
|
34
107
|
.map((report, index, array) => `${report.instrument ?? ''} - ${report.date ?? ''}${index < array.length - 1 ? ', ' : ''}`);
|
|
35
108
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaWarningComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: MapaWarningComponent, isStandalone: true, selector: "mapa-warning", inputs: { lowReliabilityReports: "lowReliabilityReports" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaWarningComponent, deps: [{ token: MapaI18nService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: MapaWarningComponent, isStandalone: true, selector: "mapa-warning", inputs: { lowReliabilityReports: "lowReliabilityReports" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n {{ lowReliabilityTitle }}\n <span *ngFor=\"let report of nonExpirationDateReports\">{{ report }}</span>.\n </p>\n <p *ngIf=\"showSecondLine\">\n {{ expirationLimitTitle }}\n <span *ngFor=\"let report of expirationDateReports\">{{ report }}</span>.\n </p>\n </article>\n</section>\n", styles: [".warning{background:#eedb2a!important;display:flex;align-items:flex-start;padding:21px 45px;margin-top:16px}.warning p{font-family:var(--mapa-font-body, \"Asap\", \"Roboto\", \"Inter\", sans-serif);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0}.warning__icon{margin-right:16px;margin-top:auto;margin-bottom:auto;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
38
111
|
}
|
|
39
112
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaWarningComponent, decorators: [{
|
|
40
113
|
type: Component,
|
|
41
|
-
args: [{ selector: 'mapa-warning', imports: [CommonModule], standalone: true, template: "<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n
|
|
42
|
-
}], propDecorators: { lowReliabilityReports: [{
|
|
114
|
+
args: [{ selector: 'mapa-warning', imports: [CommonModule], standalone: true, template: "<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n {{ lowReliabilityTitle }}\n <span *ngFor=\"let report of nonExpirationDateReports\">{{ report }}</span>.\n </p>\n <p *ngIf=\"showSecondLine\">\n {{ expirationLimitTitle }}\n <span *ngFor=\"let report of expirationDateReports\">{{ report }}</span>.\n </p>\n </article>\n</section>\n", styles: [".warning{background:#eedb2a!important;display:flex;align-items:flex-start;padding:21px 45px;margin-top:16px}.warning p{font-family:var(--mapa-font-body, \"Asap\", \"Roboto\", \"Inter\", sans-serif);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0}.warning__icon{margin-right:16px;margin-top:auto;margin-bottom:auto;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
115
|
+
}], ctorParameters: () => [{ type: MapaI18nService }], propDecorators: { lowReliabilityReports: [{
|
|
43
116
|
type: Input
|
|
44
117
|
}] } });
|
|
45
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapa-library-ui-src-lib-components-warning.mjs","sources":["../../../projects/mapa-library-ui/src/lib/components/warning/src/warning.component.ts","../../../projects/mapa-library-ui/src/lib/components/warning/src/warning.component.html","../../../projects/mapa-library-ui/src/lib/components/warning/public-api.ts","../../../projects/mapa-library-ui/src/warning.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-warning.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\n\nexport interface LowReliabilityReport {\n instrument?: string;\n date?: string;\n isExpirationDate?: boolean;\n}\n\n@Component({\n selector: 'mapa-warning',\n templateUrl: './warning.component.html',\n styleUrl: './warning.component.scss',\n imports: [CommonModule],\n standalone: true\n})\nexport class MapaWarningComponent implements OnInit, OnChanges {\n @Input() lowReliabilityReports: LowReliabilityReport[] = [];\n showFirstLine: boolean = false;\n showSecondLine: boolean = false;\n expirationDateReports: string[] = [];\n nonExpirationDateReports: string[] = [];\n\n ngOnInit(): void {\n this.updateVisibilityFlags();\n this.generateReportArrays();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['lowReliabilityReports']) {\n this.updateVisibilityFlags();\n this.generateReportArrays();\n }\n }\n\n updateVisibilityFlags(): void {\n this.showFirstLine = this.lowReliabilityReports.some(\n (report) => !!report.instrument && !!report.date\n );\n this.showSecondLine = this.lowReliabilityReports.some(\n (report) => !!report.isExpirationDate\n );\n }\n\n generateReportArrays(): void {\n this.expirationDateReports = this.lowReliabilityReports\n .filter((report) => !!report.isExpirationDate)\n .map(\n (report, index, array) =>\n `${report.instrument ?? ''} - ${report.date ?? ''}${index < array.length - 1 ? ', ' : ''}`\n );\n\n this.nonExpirationDateReports = this.lowReliabilityReports\n .filter((report) => !report.isExpirationDate)\n .map(\n (report, index, array) =>\n `${report.instrument ?? ''} - ${report.date ?? ''}${index < array.length - 1 ? ', ' : ''}`\n );\n }\n}\n","<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n Nível baixo de confiabilidade no(s) teste(s): \n <span *ngFor=\"let report of nonExpirationDateReports\">{{ report }}</span>.\n </p>\n <p *ngIf=\"showSecondLine\">\n O prazo de validade do(s) teste(s) está no limite: \n <span *ngFor=\"let report of expirationDateReports\">{{ report }}</span>.\n </p>\n </article>\n</section>\n","/*\n * Public API Surface of mapa-library-ui icon\n */\n\nexport * from './src/warning.component';\n","/*\n * Public API Surface of mapa-library-ui warning\n */\n\nexport * from './lib/components/warning/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './warning';\n"],"names":[],"mappings":";;;;;MAgBa,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;QAQW,IAAA,CAAA,qBAAqB,GAA2B,EAAE;QAC3D,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;;;AEjBH;;AAEG;;ACFH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-components-warning.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/i18n/mapa-ui-texts.ts","../../../projects/mapa-library-ui/src/lib/core/services/mapa-i18n.service.ts","../../../projects/mapa-library-ui/src/lib/components/warning/src/warning.component.ts","../../../projects/mapa-library-ui/src/lib/components/warning/src/warning.component.html","../../../projects/mapa-library-ui/src/lib/components/warning/public-api.ts","../../../projects/mapa-library-ui/src/warning.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-warning.ts"],"sourcesContent":["import { InjectionToken, Provider } from \"@angular/core\";\nimport {\n MapaUiTextGroups,\n PartialMapaUiTexts,\n ValidationContext,\n ValidationTextResolver,\n getMapaUiTexts,\n} from \"mapa-frontend-i18n\";\n\nexport type MapaUiTexts = MapaUiTextGroups;\nexport type ValidationMessageContext = ValidationContext;\nexport type { PartialMapaUiTexts, ValidationTextResolver };\n\nexport const MAPA_UI_TEXTS = new InjectionToken<PartialMapaUiTexts>(\n \"MAPA_UI_TEXTS\"\n);\n\nfunction getDefaultTexts(): MapaUiTexts {\n return getMapaUiTexts(\"pt-BR\") as MapaUiTexts;\n}\n\nexport function mergeMapaUiTexts(\n customTexts?: PartialMapaUiTexts | null\n): MapaUiTexts {\n const defaults = getDefaultTexts();\n\n return {\n common: { ...defaults.common, ...(customTexts?.common ?? {}) },\n filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },\n datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },\n capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },\n paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },\n warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },\n table: { ...defaults.table, ...(customTexts?.table ?? {}) },\n validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },\n };\n}\n\nexport function provideMapaUiTexts(texts: PartialMapaUiTexts): Provider {\n return {\n provide: MAPA_UI_TEXTS,\n useValue: texts,\n };\n}\n","import { Inject, Injectable, Injector, Optional, inject, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport {\n MAPA_UI_TEXTS,\n MapaUiTexts,\n PartialMapaUiTexts,\n ValidationMessageContext,\n ValidationTextResolver,\n mergeMapaUiTexts,\n} from \"../i18n/mapa-ui-texts\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MapaI18nService {\n private readonly injector = inject(Injector);\n private readonly textsState = signal<MapaUiTexts>(mergeMapaUiTexts());\n\n readonly textsSignal = this.textsState.asReadonly();\n readonly texts$ = toObservable(this.textsSignal, { injector: this.injector });\n\n constructor(\n @Optional() @Inject(MAPA_UI_TEXTS) customTexts: PartialMapaUiTexts | null\n ) {\n if (customTexts) {\n this.textsState.set(mergeMapaUiTexts(customTexts));\n }\n }\n\n get texts(): MapaUiTexts {\n return this.textsState();\n }\n\n setTexts(texts: PartialMapaUiTexts): void {\n this.textsState.set(mergeMapaUiTexts(texts));\n }\n\n resolveValidationText(\n key: keyof MapaUiTexts[\"validation\"],\n context?: ValidationMessageContext\n ): string {\n return this.resolveText(this.texts.validation[key], context);\n }\n\n private resolveText(\n value: ValidationTextResolver,\n context?: ValidationMessageContext\n ): string {\n return typeof value === \"function\" ? value(context) : value;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\n\nimport { MapaI18nService } from '../../../core/services/mapa-i18n.service';\n\nexport interface LowReliabilityReport {\n instrument?: string;\n date?: string;\n isExpirationDate?: boolean;\n}\n\n@Component({\n selector: 'mapa-warning',\n templateUrl: './warning.component.html',\n styleUrl: './warning.component.scss',\n imports: [CommonModule],\n standalone: true\n})\nexport class MapaWarningComponent implements OnInit, OnChanges {\n @Input() lowReliabilityReports: LowReliabilityReport[] = [];\n showFirstLine: boolean = false;\n showSecondLine: boolean = false;\n expirationDateReports: string[] = [];\n nonExpirationDateReports: string[] = [];\n\n constructor(private readonly i18n: MapaI18nService) {}\n\n get texts() {\n return this.i18n.textsSignal();\n }\n\n get lowReliabilityTitle(): string {\n return this.texts.warning.lowReliabilityTitle;\n }\n\n get expirationLimitTitle(): string {\n return this.texts.warning.expirationLimitTitle;\n }\n\n ngOnInit(): void {\n this.updateVisibilityFlags();\n this.generateReportArrays();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['lowReliabilityReports']) {\n this.updateVisibilityFlags();\n this.generateReportArrays();\n }\n }\n\n updateVisibilityFlags(): void {\n this.showFirstLine = this.lowReliabilityReports.some(\n (report) => !!report.instrument && !!report.date\n );\n this.showSecondLine = this.lowReliabilityReports.some(\n (report) => !!report.isExpirationDate\n );\n }\n\n generateReportArrays(): void {\n this.expirationDateReports = this.lowReliabilityReports\n .filter((report) => !!report.isExpirationDate)\n .map(\n (report, index, array) =>\n `${report.instrument ?? ''} - ${report.date ?? ''}${index < array.length - 1 ? ', ' : ''}`\n );\n\n this.nonExpirationDateReports = this.lowReliabilityReports\n .filter((report) => !report.isExpirationDate)\n .map(\n (report, index, array) =>\n `${report.instrument ?? ''} - ${report.date ?? ''}${index < array.length - 1 ? ', ' : ''}`\n );\n }\n}\n","<section class=\"warning\">\n <div class=\"warning__icon\">\n <img src=\"assets/images/icons/Warning.svg\" />\n </div>\n <article>\n <p *ngIf=\"showFirstLine\">\n {{ lowReliabilityTitle }}\n <span *ngFor=\"let report of nonExpirationDateReports\">{{ report }}</span>.\n </p>\n <p *ngIf=\"showSecondLine\">\n {{ expirationLimitTitle }}\n <span *ngFor=\"let report of expirationDateReports\">{{ report }}</span>.\n </p>\n </article>\n</section>\n","/*\n * Public API Surface of mapa-library-ui icon\n */\n\nexport * from './src/warning.component';\n","/*\n * Public API Surface of mapa-library-ui warning\n */\n\nexport * from './lib/components/warning/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './warning';\n"],"names":["i1.MapaI18nService"],"mappings":";;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