@seniorsistemas/angular-components 19.9.11 → 19.9.12-develop-18460917

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 (52) hide show
  1. package/dynamic-form/dynamic-form/form-field/addon-config.d.ts +12 -0
  2. package/dynamic-form/dynamic-form/form-field/configurations/fields/text-area-field.d.ts +5 -0
  3. package/dynamic-form/dynamic-form/form-field/configurations/fields/text-field.d.ts +0 -1
  4. package/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.d.ts +1 -0
  5. package/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.d.ts +1 -0
  6. package/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.d.ts +1 -0
  7. package/dynamic-form/dynamic-form/form-field/fields/password/password-field.component.d.ts +4 -0
  8. package/dynamic-form/dynamic-form/form-field/fields/text/text-field.component.d.ts +1 -0
  9. package/esm2022/content-generator/lib/content-generator/content-generator.component.mjs +2 -2
  10. package/esm2022/control-errors/lib/control-errors/control-errors.component.mjs +3 -3
  11. package/esm2022/datepicker/lib/datepicker/datepicker.component.mjs +3 -3
  12. package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +3 -3
  13. package/esm2022/dynamic-form/dynamic-form/form-field/addon-config.mjs +29 -2
  14. package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/text-area-field.mjs +1 -1
  15. package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/text-field.mjs +1 -1
  16. package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +8 -7
  17. package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +6 -5
  18. package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +8 -7
  19. package/esm2022/dynamic-form/dynamic-form/form-field/fields/password/password-field.component.mjs +14 -5
  20. package/esm2022/dynamic-form/dynamic-form/form-field/fields/text/text-field.component.mjs +8 -7
  21. package/esm2022/dynamic-form/dynamic-form/form-field/fields/text-area/text-area-field.component.mjs +3 -3
  22. package/esm2022/input-group/lib/input-group/input-group.component.mjs +37 -0
  23. package/esm2022/input-group/lib/input-group/input-group.module.mjs +16 -0
  24. package/esm2022/input-group/lib/input-group/types/input-group-addon.mjs +2 -0
  25. package/esm2022/input-group/public-api.mjs +3 -0
  26. package/esm2022/input-group/seniorsistemas-angular-components-input-group.mjs +5 -0
  27. package/esm2022/select/lib/select/select.component.mjs +3 -3
  28. package/esm2022/text-area/lib/text-area/text-area.component.mjs +21 -6
  29. package/fesm2022/seniorsistemas-angular-components-content-generator.mjs +1 -1
  30. package/fesm2022/seniorsistemas-angular-components-content-generator.mjs.map +1 -1
  31. package/fesm2022/seniorsistemas-angular-components-control-errors.mjs +2 -2
  32. package/fesm2022/seniorsistemas-angular-components-control-errors.mjs.map +1 -1
  33. package/fesm2022/seniorsistemas-angular-components-datepicker.mjs +2 -2
  34. package/fesm2022/seniorsistemas-angular-components-datepicker.mjs.map +1 -1
  35. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +62 -22
  36. package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
  37. package/fesm2022/seniorsistemas-angular-components-input-group.mjs +57 -0
  38. package/fesm2022/seniorsistemas-angular-components-input-group.mjs.map +1 -0
  39. package/fesm2022/seniorsistemas-angular-components-select.mjs +2 -2
  40. package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
  41. package/fesm2022/seniorsistemas-angular-components-text-area.mjs +20 -5
  42. package/fesm2022/seniorsistemas-angular-components-text-area.mjs.map +1 -1
  43. package/input-group/README.md +106 -0
  44. package/input-group/index.d.ts +5 -0
  45. package/input-group/lib/input-group/input-group.component.d.ts +27 -0
  46. package/input-group/lib/input-group/input-group.module.d.ts +7 -0
  47. package/input-group/lib/input-group/types/input-group-addon.d.ts +10 -0
  48. package/input-group/package.json +3 -0
  49. package/input-group/public-api.d.ts +3 -0
  50. package/package.json +7 -1
  51. package/styles.css +1 -0
  52. package/text-area/lib/text-area/text-area.component.d.ts +12 -3
@@ -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,CAAC,CAAC;KACN;;AAGQ,IAAA,OAAO,GAAG,CAAY,SAAA,EAAA,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;;IAEtC,IAAI,GAAG,CAAC,CAAC;;IAET,iBAAiB,GAAG,KAAK,CAAC;;AAE1B,IAAA,SAAS,CAA+C;;IAExD,WAAW,GAAG,KAAK,CAAC;;IAEpB,4BAA4B,GAAG,EAAE,CAAC;;IAElC,SAAS,GAAkB,IAAI,CAAC;;AAEhC,IAAA,WAAW,CAAqB;AAEjC,IAAA,WAAW,GAAiC;AAChD,QAAA,MAAM,EAAE,UAAU;KACrB,CAAC;;AAEF,IAAA,IAAa,UAAU,GAAA;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;KAC3B;IACD,IAAI,UAAU,CAAC,KAAmC,EAAA;QAC9C,IAAI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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;;;;;;;;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BAclC,OAAO,EAAA,CAAA;sBAAf,KAAK;gBAEG,IAAI,EAAA,CAAA;sBAAZ,KAAK;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;;;MErFG,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;;;;"}
@@ -0,0 +1,106 @@
1
+ # InputGroup
2
+
3
+ ![Status](https://img.shields.io/badge/status-stable-brightgreen)
4
+
5
+ Componente de layout que envolve um `<input sInputText>` e adiciona botões internos à esquerda e/ou à direita do campo.
6
+
7
+ ## Quando usar
8
+
9
+ - Campos de busca com botão de lupa integrado
10
+ - Campos com ação de limpar, copiar ou alternar visibilidade (ex.: senha) dentro do próprio input
11
+ - Qualquer `<input sInputText>` que precise de uma ou duas ações contextuais coladas ao campo
12
+
13
+ ## Quando não usar
14
+
15
+ - Para campos do `DynamicForm` — os campos `text`/`number`/`bignumber` já suportam `leftAddon`/`rightAddon` nativamente via configuração do campo
16
+ - Quando a ação não tem relação direta com o conteúdo do input — use um botão normal ao lado do campo, fora do `InputGroup`
17
+
18
+ ## Instalação
19
+
20
+ ```typescript
21
+ import { InputGroupComponent } from '@seniorsistemas/angular-components/input-group';
22
+ import { InputTextDirective } from '@seniorsistemas/angular-components/input-text';
23
+
24
+ @Component({
25
+ standalone: true,
26
+ imports: [InputGroupComponent, InputTextDirective, ReactiveFormsModule],
27
+ })
28
+ export class MeuComponente {
29
+ control = new FormControl('');
30
+ }
31
+ ```
32
+
33
+ ## Uso básico
34
+
35
+ ```html
36
+ <s-input-group [leftAddon]="{ icon: 'pi pi-search', callback: buscar }">
37
+ <input sInputText [formControl]="control" placeholder="Buscar..." />
38
+ </s-input-group>
39
+ ```
40
+
41
+ ## API
42
+
43
+ ### Inputs
44
+
45
+ | Propriedade | Tipo | Padrão | Obrigatório | Descrição |
46
+ |-------------|------|--------|:-----------:|-----------|
47
+ | `leftAddon` | `InputGroupAddon` | `undefined` | Não | Configuração do botão exibido à esquerda do input |
48
+ | `rightAddon` | `InputGroupAddon` | `undefined` | Não | Configuração do botão exibido à direita do input |
49
+
50
+ ### Tipos
51
+
52
+ ```typescript
53
+ interface InputGroupAddon {
54
+ label?: string;
55
+ icon?: string;
56
+ callback?: VoidFunction;
57
+ disabled?: (() => boolean) | boolean;
58
+ }
59
+ ```
60
+
61
+ ## Exemplos
62
+
63
+ ### Botão de busca à esquerda
64
+
65
+ ```html
66
+ <s-input-group [leftAddon]="{ icon: 'pi pi-search', callback: buscar }">
67
+ <input sInputText [formControl]="nome" placeholder="Buscar..." />
68
+ </s-input-group>
69
+ ```
70
+
71
+ ### Botão de limpar à direita, desabilitado quando o campo está vazio
72
+
73
+ ```html
74
+ <s-input-group [rightAddon]="{ icon: 'pi pi-times', callback: limpar, disabled: campoVazio }">
75
+ <input sInputText [formControl]="nome" />
76
+ </s-input-group>
77
+ ```
78
+
79
+ ### Botões dos dois lados
80
+
81
+ ```html
82
+ <s-input-group
83
+ [leftAddon]="{ icon: 'pi pi-search', callback: buscar }"
84
+ [rightAddon]="{ icon: 'pi pi-times', callback: limpar }"
85
+ >
86
+ <input sInputText [formControl]="nome" />
87
+ </s-input-group>
88
+ ```
89
+
90
+ ### Botão desabilitado a partir do estado do form
91
+
92
+ ```html
93
+ <s-input-group [rightAddon]="{ icon: 'pi pi-times', callback: limpar, disabled: () => nome.disabled }">
94
+ <input sInputText [formControl]="nome" />
95
+ </s-input-group>
96
+ ```
97
+
98
+ ## Acessibilidade
99
+
100
+ - Os botões internos são `<button type="button">` nativos — recebem foco via teclado (Tab) normalmente
101
+ - Quando `disabled` (fixo ou via função) é verdadeiro, o atributo `disabled` nativo é aplicado ao botão
102
+
103
+ ## Componentes relacionados
104
+
105
+ - [`InputText`](../input-text/README.md) — diretiva de estilo aplicada ao `<input>` projetado dentro do `InputGroup`
106
+ - [`DynamicForm`](../dynamic-form/README.md) — campos de formulário completos que já suportam addons nativamente, sem precisar do `InputGroup`
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@seniorsistemas/angular-components/input-group" />
5
+ export * from './public-api';
@@ -0,0 +1,27 @@
1
+ import { InputGroupAddon } from './types/input-group-addon';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * @description Componente de layout que envolve um `<input sInputText>` (projetado via
5
+ * `ng-content`) e adiciona botões internos à esquerda e/ou à direita do campo.
6
+ *
7
+ * O `<input>` projetado continua totalmente sob controle do consumidor — combine
8
+ * livremente com `[formControl]`/`[(ngModel)]`, `sInputMask`, `pKeyFilter`, `sTooltip`, etc.
9
+ *
10
+ * @example
11
+ * ```html
12
+ * <s-input-group [leftAddon]="{ icon: 'pi pi-search', callback: buscar }">
13
+ * <input sInputText [formControl]="nome" placeholder="Buscar..." />
14
+ * </s-input-group>
15
+ * ```
16
+ *
17
+ * @category Structure
18
+ */
19
+ export declare class InputGroupComponent {
20
+ /** @description Configuração do botão exibido à esquerda do input. */
21
+ leftAddon: import("@angular/core").InputSignal<InputGroupAddon | undefined>;
22
+ /** @description Configuração do botão exibido à direita do input. */
23
+ rightAddon: import("@angular/core").InputSignal<InputGroupAddon | undefined>;
24
+ protected isAddonDisabled(addon: InputGroupAddon): boolean;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputGroupComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputGroupComponent, "s-input-group", never, { "leftAddon": { "alias": "leftAddon"; "required": false; "isSignal": true; }; "rightAddon": { "alias": "rightAddon"; "required": false; "isSignal": true; }; }, {}, never, ["input[sInputText]"], true, never>;
27
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./input-group.component";
3
+ export declare class InputGroupModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputGroupModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<InputGroupModule, never, [typeof i1.InputGroupComponent], [typeof i1.InputGroupComponent]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<InputGroupModule>;
7
+ }
@@ -0,0 +1,10 @@
1
+ export interface InputGroupAddon {
2
+ /** @description Texto exibido no botão. */
3
+ label?: string;
4
+ /** @description Classe do ícone exibido no botão (ex.: `'pi pi-search'`). */
5
+ icon?: string;
6
+ /** @description Função executada ao clicar no botão. */
7
+ callback?: VoidFunction;
8
+ /** @description Desabilita o botão. Aceita um valor fixo ou uma função avaliada a cada verificação (ex.: para refletir o estado do form). */
9
+ disabled?: (() => boolean) | boolean;
10
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/seniorsistemas-angular-components-input-group.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ export { InputGroupModule } from './lib/input-group/input-group.module';
2
+ export { InputGroupComponent } from './lib/input-group/input-group.component';
3
+ export type { InputGroupAddon } from './lib/input-group/types/input-group-addon';
package/package.json CHANGED
@@ -262,6 +262,12 @@
262
262
  "esm2022": "./esm2022/inline-edit/seniorsistemas-angular-components-inline-edit.mjs",
263
263
  "types": "./inline-edit/index.d.ts"
264
264
  },
265
+ "./input-group": {
266
+ "default": "./fesm2022/seniorsistemas-angular-components-input-group.mjs",
267
+ "esm": "./esm2022/input-group/seniorsistemas-angular-components-input-group.mjs",
268
+ "esm2022": "./esm2022/input-group/seniorsistemas-angular-components-input-group.mjs",
269
+ "types": "./input-group/index.d.ts"
270
+ },
265
271
  "./input-mask": {
266
272
  "default": "./fesm2022/seniorsistemas-angular-components-input-mask.mjs",
267
273
  "esm": "./esm2022/input-mask/seniorsistemas-angular-components-input-mask.mjs",
@@ -701,5 +707,5 @@
701
707
  "schematics": "./schematics/collection.json",
702
708
  "sideEffects": true,
703
709
  "typings": "index.d.ts",
704
- "version": "19.9.11"
710
+ "version": "19.9.12-develop-18460917"
705
711
  }
package/styles.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @import '@angular/cdk/overlay-prebuilt.css';
2
+ @import '@angular/cdk/a11y-prebuilt.css';
2
3
 
3
4
  :root {
4
5
  --s-focus-ring-color: #0090ff;
@@ -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
  }