@seniorsistemas/angular-components 19.9.12 → 19.9.13
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/dynamic-form/dynamic-form/form-field/configurations/fields/text-area-field.d.ts +5 -0
- package/esm2022/content-generator/lib/content-generator/content-generator.component.mjs +2 -2
- package/esm2022/control-errors/lib/control-errors/control-errors.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/text-area-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/text-area/text-area-field.component.mjs +3 -3
- package/esm2022/text-area/lib/text-area/text-area.component.mjs +21 -6
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs +1 -1
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-control-errors.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs +20 -5
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs.map +1 -1
- package/package.json +1 -1
- package/text-area/lib/text-area/text-area.component.d.ts +12 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, forwardRef, ElementRef, Component, ViewChild, Input, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ChangeDetectorRef, Injector, input, forwardRef, ElementRef, Component, ViewChild, Input, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
4
|
+
import { Validators, NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
5
|
import { KeyFilter } from 'primeng/keyfilter';
|
|
6
6
|
import { NgStyle } from '@angular/common';
|
|
7
7
|
import { SpeechRecognitionComponent } from '@seniorsistemas/angular-components/speech-recognition';
|
|
@@ -25,6 +25,8 @@ import { SpeechRecognitionComponent } from '@seniorsistemas/angular-components/s
|
|
|
25
25
|
*/
|
|
26
26
|
class TextAreaComponent {
|
|
27
27
|
cdr = inject(ChangeDetectorRef);
|
|
28
|
+
injector = inject(Injector);
|
|
29
|
+
ngControl = null;
|
|
28
30
|
onChange = () => { };
|
|
29
31
|
onTouched = () => { };
|
|
30
32
|
disabled = false;
|
|
@@ -71,7 +73,20 @@ class TextAreaComponent {
|
|
|
71
73
|
}
|
|
72
74
|
/** @description Coloca o textarea em modo somente leitura. @default false */
|
|
73
75
|
readOnly = false;
|
|
76
|
+
/** @description Id(s) do(s) elemento(s) que descrevem o campo (ex.: texto de ajuda). Encaminhado como `aria-describedby` ao `<textarea>`. @default null */
|
|
77
|
+
ariaDescribedBy = input(null);
|
|
74
78
|
renderTextArea = false;
|
|
79
|
+
/** Indica se o control do formulário possui `Validators.required`. Usado em `required` e `aria-required`. */
|
|
80
|
+
get required() {
|
|
81
|
+
return this.ngControl?.control?.hasValidator(Validators.required) ?? false;
|
|
82
|
+
}
|
|
83
|
+
/** Indica se o control do formulário está inválido. Usado em `aria-invalid`. */
|
|
84
|
+
get invalid() {
|
|
85
|
+
return !!this.ngControl?.control?.invalid;
|
|
86
|
+
}
|
|
87
|
+
ngOnInit() {
|
|
88
|
+
this.ngControl = this.injector.get(NgControl, null, { self: true, optional: true });
|
|
89
|
+
}
|
|
75
90
|
writeValue(obj) {
|
|
76
91
|
this.value = obj;
|
|
77
92
|
}
|
|
@@ -97,13 +112,13 @@ class TextAreaComponent {
|
|
|
97
112
|
this.setValue(recognizedText);
|
|
98
113
|
}
|
|
99
114
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
100
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TextAreaComponent, isStandalone: true, selector: "s-textarea", inputs: { inputId: "inputId", rows: "rows", speechRecognition: "speechRecognition", keyFilter: "keyFilter", keepContext: "keepContext", speechRecognitionPlaceholder: "speechRecognitionPlaceholder", maxLength: "maxLength", placeholder: "placeholder", inputStyle: "inputStyle", readOnly: "readOnly" }, providers: [
|
|
115
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TextAreaComponent, isStandalone: true, selector: "s-textarea", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: false, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, speechRecognition: { classPropertyName: "speechRecognition", publicName: "speechRecognition", isSignal: false, isRequired: false, transformFunction: null }, keyFilter: { classPropertyName: "keyFilter", publicName: "keyFilter", isSignal: false, isRequired: false, transformFunction: null }, keepContext: { classPropertyName: "keepContext", publicName: "keepContext", isSignal: false, isRequired: false, transformFunction: null }, speechRecognitionPlaceholder: { classPropertyName: "speechRecognitionPlaceholder", publicName: "speechRecognitionPlaceholder", isSignal: false, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: false, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
101
116
|
{
|
|
102
117
|
provide: NG_VALUE_ACCESSOR,
|
|
103
118
|
useExisting: forwardRef(() => TextAreaComponent),
|
|
104
119
|
multi: true,
|
|
105
120
|
},
|
|
106
|
-
], viewQueries: [{ propertyName: "textAreaElement", first: true, predicate: ["textArea"], descendants: true, read: ElementRef }], ngImport: i0, template: "@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n", styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:none;padding:8px;display:block}.textarea:disabled{opacity:.5}.textarea:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:-2px}:host.ng-invalid.ng-dirty .textarea{border-color:#c13018}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: KeyFilter, selector: "[pKeyFilter]", inputs: ["pValidateOnly", "pKeyFilter"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SpeechRecognitionComponent, selector: "s-speech-recognition", inputs: ["textAreaElement", "keepContext", "speechRecognitionPlaceholder", "moreOptionsIconClass", "disabledSpeechRecognition"], outputs: ["recognizedText"] }] });
|
|
121
|
+
], viewQueries: [{ propertyName: "textAreaElement", first: true, predicate: ["textArea"], descendants: true, read: ElementRef }], ngImport: i0, template: "@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n", styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:none;padding:8px;display:block}.textarea:disabled{opacity:.5}.textarea:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:-2px}:host.ng-invalid.ng-dirty .textarea{border-color:#c13018}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: KeyFilter, selector: "[pKeyFilter]", inputs: ["pValidateOnly", "pKeyFilter"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SpeechRecognitionComponent, selector: "s-speech-recognition", inputs: ["textAreaElement", "keepContext", "speechRecognitionPlaceholder", "moreOptionsIconClass", "disabledSpeechRecognition"], outputs: ["recognizedText"] }] });
|
|
107
122
|
}
|
|
108
123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextAreaComponent, decorators: [{
|
|
109
124
|
type: Component,
|
|
@@ -113,7 +128,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
113
128
|
useExisting: forwardRef(() => TextAreaComponent),
|
|
114
129
|
multi: true,
|
|
115
130
|
},
|
|
116
|
-
], standalone: true, imports: [FormsModule, KeyFilter, NgStyle, SpeechRecognitionComponent], template: "@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n", styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:none;padding:8px;display:block}.textarea:disabled{opacity:.5}.textarea:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:-2px}:host.ng-invalid.ng-dirty .textarea{border-color:#c13018}\n"] }]
|
|
131
|
+
], standalone: true, imports: [FormsModule, KeyFilter, NgStyle, SpeechRecognitionComponent], template: "@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n", styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:none;padding:8px;display:block}.textarea:disabled{opacity:.5}.textarea:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:-2px}:host.ng-invalid.ng-dirty .textarea{border-color:#c13018}\n"] }]
|
|
117
132
|
}], propDecorators: { textAreaElement: [{
|
|
118
133
|
type: ViewChild,
|
|
119
134
|
args: ['textArea', { read: ElementRef }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-text-area.mjs","sources":["../../projects/angular-components/text-area/src/lib/text-area/text-area.component.ts","../../projects/angular-components/text-area/src/lib/text-area/text-area.component.html","../../projects/angular-components/text-area/src/lib/text-area.module.ts","../../projects/angular-components/text-area/src/seniorsistemas-angular-components-text-area.ts"],"sourcesContent":["import { ChangeDetectorRef, Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';\r\nimport { KeyFilterPattern, KeyFilter } from 'primeng/keyfilter';\r\nimport { NgStyle } from '@angular/common';\r\nimport { SpeechRecognitionComponent } from '@seniorsistemas/angular-components/speech-recognition';\r\n\r\n/**\r\n * @description Componente de área de texto com suporte a reconhecimento de voz,\r\n * filtro de teclas, comprimento máximo e integração com `ControlValueAccessor`.\r\n * Renderiza condicionalmente o componente `SpeechRecognitionComponent` quando\r\n * a flag `speechRecognition` está ativa.\r\n *\r\n * @example\r\n * ```html\r\n * <s-textarea\r\n * formControlName=\"descricao\"\r\n * [rows]=\"6\"\r\n * [maxLength]=\"500\"\r\n * placeholder=\"Digite aqui...\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-textarea',\r\n templateUrl: './text-area.component.html',\r\n styleUrls: ['./text-area.component.scss'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => TextAreaComponent),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n imports: [FormsModule, KeyFilter, NgStyle, SpeechRecognitionComponent],\r\n})\r\nexport class TextAreaComponent implements ControlValueAccessor {\r\n private readonly cdr = inject(ChangeDetectorRef);\r\n\r\n onChange: (value: string) => void = () => {};\r\n onTouched: (value: string) => void = () => {};\r\n disabled = false;\r\n value = '';\r\n private _textAreaElement: ElementRef<HTMLTextAreaElement> | undefined;\r\n\r\n @ViewChild('textArea', { read: ElementRef })\r\n public get textAreaElement(): ElementRef<HTMLTextAreaElement> {\r\n return this._textAreaElement as ElementRef<HTMLTextAreaElement>;\r\n }\r\n\r\n public set textAreaElement(value: ElementRef<HTMLTextAreaElement>) {\r\n this._textAreaElement = value;\r\n setTimeout(() => {\r\n this.renderTextArea = true;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n /** @description Identificador do elemento `<textarea>` no DOM. @default 'textarea-{random}' */\r\n @Input() inputId = `textarea-${Math.random()}`;\r\n /** @description Número de linhas visíveis no textarea. @default 5 */\r\n @Input() rows = 5;\r\n /** @description Habilita o botão de reconhecimento de voz. @default false */\r\n @Input() speechRecognition = false;\r\n /** @description Filtro de teclas aceitas, usando padrão ou expressão regular. */\r\n @Input() keyFilter: RegExp | KeyFilterPattern | null | undefined;\r\n /** @description Quando `true`, mantém o contexto ao reiniciar o reconhecimento de voz. @default false */\r\n @Input() keepContext = false;\r\n /** @description Placeholder exibido durante o reconhecimento de voz. @default '' */\r\n @Input() speechRecognitionPlaceholder = '';\r\n /** @description Número máximo de caracteres aceitos. @default null (ilimitado) */\r\n @Input() maxLength: number | null = null;\r\n /** @description Texto exibido quando o campo está vazio. */\r\n @Input() placeholder: string | undefined;\r\n\r\n private _inputStyle: Partial<CSSStyleDeclaration> = {\r\n resize: 'vertical',\r\n };\r\n /** @description Estilos inline aplicados ao elemento `<textarea>` interno. @default `{ resize: 'vertical' }` */\r\n @Input() get inputStyle(): Partial<CSSStyleDeclaration> {\r\n return this._inputStyle;\r\n }\r\n set inputStyle(value: Partial<CSSStyleDeclaration>) {\r\n this._inputStyle = {\r\n ...value,\r\n ...this._inputStyle,\r\n };\r\n }\r\n /** @description Coloca o textarea em modo somente leitura. @default false */\r\n @Input() readOnly = false;\r\n\r\n renderTextArea = false;\r\n\r\n writeValue(obj: string): void {\r\n this.value = obj;\r\n }\r\n\r\n registerOnChange(fn: (value: string) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n }\r\n\r\n setValue(value: string | number) {\r\n if (this.disabled) {\r\n return;\r\n }\r\n this.value = value.toString();\r\n this.writeValue(this.value);\r\n this.onChange(this.value);\r\n this.onTouched(this.value);\r\n }\r\n\r\n handleRecognizedText(recognizedText: string) {\r\n this.setValue(recognizedText);\r\n }\r\n}\r\n","@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { TextAreaComponent } from './text-area/text-area.component';\r\n\r\n@NgModule({\r\n imports: [TextAreaComponent],\r\n exports: [TextAreaComponent],\r\n})\r\nexport class TextAreaModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;;;;;;;;;;;;;;AAgBG;MAeU,iBAAiB,CAAA;AACT,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEjD,IAAA,QAAQ,GAA4B,MAAK,GAAG,CAAC;AAC7C,IAAA,SAAS,GAA4B,MAAK,GAAG,CAAC;IAC9C,QAAQ,GAAG,KAAK,CAAC;IACjB,KAAK,GAAG,EAAE,CAAC;AACH,IAAA,gBAAgB,CAA8C;AAEtE,IAAA,IACW,eAAe,GAAA;QACtB,OAAO,IAAI,CAAC,gBAAmD,CAAC;KACnE;IAED,IAAW,eAAe,CAAC,KAAsC,EAAA;AAC7D,QAAA,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,UAAU,CAAC,MAAK;AACZ,YAAA,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;AAC3B,YAAA,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;AAC7B,SAAC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AK;gBAEG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBAEG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBAEG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAEG,4BAA4B,EAAA,CAAA;sBAApC,KAAK;gBAEG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBAEG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMO,UAAU,EAAA,CAAA;sBAAtB,KAAK;gBAUG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;;;MEnFG,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,OAAA,EAAA,CAHb,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAElB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHb,iBAAiB,CAAA,EAAA,CAAA,CAAA;;4FAGlB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-text-area.mjs","sources":["../../projects/angular-components/text-area/src/lib/text-area/text-area.component.ts","../../projects/angular-components/text-area/src/lib/text-area/text-area.component.html","../../projects/angular-components/text-area/src/lib/text-area.module.ts","../../projects/angular-components/text-area/src/seniorsistemas-angular-components-text-area.ts"],"sourcesContent":["import { ChangeDetectorRef, Component, ElementRef, forwardRef, Injector, Input, OnInit, ViewChild, inject, input } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule, NgControl, Validators } from '@angular/forms';\r\nimport { KeyFilterPattern, KeyFilter } from 'primeng/keyfilter';\r\nimport { NgStyle } from '@angular/common';\r\nimport { SpeechRecognitionComponent } from '@seniorsistemas/angular-components/speech-recognition';\r\n\r\n/**\r\n * @description Componente de área de texto com suporte a reconhecimento de voz,\r\n * filtro de teclas, comprimento máximo e integração com `ControlValueAccessor`.\r\n * Renderiza condicionalmente o componente `SpeechRecognitionComponent` quando\r\n * a flag `speechRecognition` está ativa.\r\n *\r\n * @example\r\n * ```html\r\n * <s-textarea\r\n * formControlName=\"descricao\"\r\n * [rows]=\"6\"\r\n * [maxLength]=\"500\"\r\n * placeholder=\"Digite aqui...\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-textarea',\r\n templateUrl: './text-area.component.html',\r\n styleUrls: ['./text-area.component.scss'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => TextAreaComponent),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n imports: [FormsModule, KeyFilter, NgStyle, SpeechRecognitionComponent],\r\n})\r\nexport class TextAreaComponent implements ControlValueAccessor, OnInit {\r\n private readonly cdr = inject(ChangeDetectorRef);\r\n private readonly injector = inject(Injector);\r\n private ngControl: NgControl | null = null;\r\n\r\n onChange: (value: string) => void = () => {};\r\n onTouched: (value: string) => void = () => {};\r\n disabled = false;\r\n value = '';\r\n private _textAreaElement: ElementRef<HTMLTextAreaElement> | undefined;\r\n\r\n @ViewChild('textArea', { read: ElementRef })\r\n public get textAreaElement(): ElementRef<HTMLTextAreaElement> {\r\n return this._textAreaElement as ElementRef<HTMLTextAreaElement>;\r\n }\r\n\r\n public set textAreaElement(value: ElementRef<HTMLTextAreaElement>) {\r\n this._textAreaElement = value;\r\n setTimeout(() => {\r\n this.renderTextArea = true;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n /** @description Identificador do elemento `<textarea>` no DOM. @default 'textarea-{random}' */\r\n @Input() inputId = `textarea-${Math.random()}`;\r\n /** @description Número de linhas visíveis no textarea. @default 5 */\r\n @Input() rows = 5;\r\n /** @description Habilita o botão de reconhecimento de voz. @default false */\r\n @Input() speechRecognition = false;\r\n /** @description Filtro de teclas aceitas, usando padrão ou expressão regular. */\r\n @Input() keyFilter: RegExp | KeyFilterPattern | null | undefined;\r\n /** @description Quando `true`, mantém o contexto ao reiniciar o reconhecimento de voz. @default false */\r\n @Input() keepContext = false;\r\n /** @description Placeholder exibido durante o reconhecimento de voz. @default '' */\r\n @Input() speechRecognitionPlaceholder = '';\r\n /** @description Número máximo de caracteres aceitos. @default null (ilimitado) */\r\n @Input() maxLength: number | null = null;\r\n /** @description Texto exibido quando o campo está vazio. */\r\n @Input() placeholder: string | undefined;\r\n\r\n private _inputStyle: Partial<CSSStyleDeclaration> = {\r\n resize: 'vertical',\r\n };\r\n /** @description Estilos inline aplicados ao elemento `<textarea>` interno. @default `{ resize: 'vertical' }` */\r\n @Input() get inputStyle(): Partial<CSSStyleDeclaration> {\r\n return this._inputStyle;\r\n }\r\n set inputStyle(value: Partial<CSSStyleDeclaration>) {\r\n this._inputStyle = {\r\n ...value,\r\n ...this._inputStyle,\r\n };\r\n }\r\n /** @description Coloca o textarea em modo somente leitura. @default false */\r\n @Input() readOnly = false;\r\n /** @description Id(s) do(s) elemento(s) que descrevem o campo (ex.: texto de ajuda). Encaminhado como `aria-describedby` ao `<textarea>`. @default null */\r\n ariaDescribedBy = input<string | null>(null);\r\n\r\n renderTextArea = false;\r\n\r\n /** Indica se o control do formulário possui `Validators.required`. Usado em `required` e `aria-required`. */\r\n get required(): boolean {\r\n return this.ngControl?.control?.hasValidator(Validators.required) ?? false;\r\n }\r\n\r\n /** Indica se o control do formulário está inválido. Usado em `aria-invalid`. */\r\n get invalid(): boolean {\r\n return !!this.ngControl?.control?.invalid;\r\n }\r\n\r\n ngOnInit(): void {\r\n this.ngControl = this.injector.get(NgControl, null, { self: true, optional: true });\r\n }\r\n\r\n writeValue(obj: string): void {\r\n this.value = obj;\r\n }\r\n\r\n registerOnChange(fn: (value: string) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n }\r\n\r\n setValue(value: string | number) {\r\n if (this.disabled) {\r\n return;\r\n }\r\n this.value = value.toString();\r\n this.writeValue(this.value);\r\n this.onChange(this.value);\r\n this.onTouched(this.value);\r\n }\r\n\r\n handleRecognizedText(recognizedText: string) {\r\n this.setValue(recognizedText);\r\n }\r\n}\r\n","@if (keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [pKeyFilter]=\"keyFilter\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"setValue($event)\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n ></textarea>\r\n}\r\n\r\n@if (!keyFilter) {\r\n <textarea\r\n #textArea\r\n class=\"textarea\"\r\n [id]=\"inputId\"\r\n [rows]=\"rows\"\r\n [(ngModel)]=\"value\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"inputStyle\"\r\n [readOnly]=\"readOnly\"\r\n [attr.required]=\"required ? '' : null\"\r\n [attr.aria-required]=\"required || null\"\r\n [attr.aria-invalid]=\"invalid || null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\"\r\n [maxlength]=\"maxLength\"\r\n [placeholder]=\"placeholder ? placeholder : ''\"\r\n (ngModelChange)=\"setValue($event)\"\r\n ></textarea>\r\n}\r\n\r\n@if (speechRecognition && renderTextArea) {\r\n <s-speech-recognition\r\n [textAreaElement]=\"textAreaElement.nativeElement\"\r\n [keepContext]=\"keepContext\"\r\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\r\n [disabledSpeechRecognition]=\"disabled\"\r\n (recognizedText)=\"handleRecognizedText($event)\"\r\n />\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { TextAreaComponent } from './text-area/text-area.component';\r\n\r\n@NgModule({\r\n imports: [TextAreaComponent],\r\n exports: [TextAreaComponent],\r\n})\r\nexport class TextAreaModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAMA;;;;;;;;;;;;;;;;AAgBG;MAeU,iBAAiB,CAAA;AACT,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAS,GAAqB,IAAI,CAAC;AAE3C,IAAA,QAAQ,GAA4B,MAAK,GAAG,CAAC;AAC7C,IAAA,SAAS,GAA4B,MAAK,GAAG,CAAC;IAC9C,QAAQ,GAAG,KAAK,CAAC;IACjB,KAAK,GAAG,EAAE,CAAC;AACH,IAAA,gBAAgB,CAA8C;AAEtE,IAAA,IACW,eAAe,GAAA;QACtB,OAAO,IAAI,CAAC,gBAAmD,CAAC;KACnE;IAED,IAAW,eAAe,CAAC,KAAsC,EAAA;AAC7D,QAAA,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,UAAU,CAAC,MAAK;AACZ,YAAA,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;AAC3B,YAAA,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;AAC7B,SAAC,CAAC,CAAC;KACN;;AAGQ,IAAA,OAAO,GAAG,CAAY,SA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,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHb,iBAAiB,CAAA,EAAA,CAAA,CAAA;;4FAGlB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
3
|
import { KeyFilterPattern } from 'primeng/keyfilter';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -19,8 +19,10 @@ import * as i0 from "@angular/core";
|
|
|
19
19
|
*
|
|
20
20
|
* @category Inputs
|
|
21
21
|
*/
|
|
22
|
-
export declare class TextAreaComponent implements ControlValueAccessor {
|
|
22
|
+
export declare class TextAreaComponent implements ControlValueAccessor, OnInit {
|
|
23
23
|
private readonly cdr;
|
|
24
|
+
private readonly injector;
|
|
25
|
+
private ngControl;
|
|
24
26
|
onChange: (value: string) => void;
|
|
25
27
|
onTouched: (value: string) => void;
|
|
26
28
|
disabled: boolean;
|
|
@@ -50,7 +52,14 @@ export declare class TextAreaComponent implements ControlValueAccessor {
|
|
|
50
52
|
set inputStyle(value: Partial<CSSStyleDeclaration>);
|
|
51
53
|
/** @description Coloca o textarea em modo somente leitura. @default false */
|
|
52
54
|
readOnly: boolean;
|
|
55
|
+
/** @description Id(s) do(s) elemento(s) que descrevem o campo (ex.: texto de ajuda). Encaminhado como `aria-describedby` ao `<textarea>`. @default null */
|
|
56
|
+
ariaDescribedBy: import("@angular/core").InputSignal<string | null>;
|
|
53
57
|
renderTextArea: boolean;
|
|
58
|
+
/** Indica se o control do formulário possui `Validators.required`. Usado em `required` e `aria-required`. */
|
|
59
|
+
get required(): boolean;
|
|
60
|
+
/** Indica se o control do formulário está inválido. Usado em `aria-invalid`. */
|
|
61
|
+
get invalid(): boolean;
|
|
62
|
+
ngOnInit(): void;
|
|
54
63
|
writeValue(obj: string): void;
|
|
55
64
|
registerOnChange(fn: (value: string) => void): void;
|
|
56
65
|
registerOnTouched(fn: () => void): void;
|
|
@@ -58,5 +67,5 @@ export declare class TextAreaComponent implements ControlValueAccessor {
|
|
|
58
67
|
setValue(value: string | number): void;
|
|
59
68
|
handleRecognizedText(recognizedText: string): void;
|
|
60
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextAreaComponent, never>;
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextAreaComponent, "s-textarea", never, { "inputId": { "alias": "inputId"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "speechRecognition": { "alias": "speechRecognition"; "required": false; }; "keyFilter": { "alias": "keyFilter"; "required": false; }; "keepContext": { "alias": "keepContext"; "required": false; }; "speechRecognitionPlaceholder": { "alias": "speechRecognitionPlaceholder"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inputStyle": { "alias": "inputStyle"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, {}, never, never, true, never>;
|
|
70
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextAreaComponent, "s-textarea", never, { "inputId": { "alias": "inputId"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "speechRecognition": { "alias": "speechRecognition"; "required": false; }; "keyFilter": { "alias": "keyFilter"; "required": false; }; "keepContext": { "alias": "keepContext"; "required": false; }; "speechRecognitionPlaceholder": { "alias": "speechRecognitionPlaceholder"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inputStyle": { "alias": "inputStyle"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
62
71
|
}
|