` |
+| form-field-checkbox-horizontal | Adds a label for a checkbox or radio field, adds red styling and error messages for invalid fields. Uses `validators.validation` and `validation.messages` properties. Adds a tooltip behind the label, see also tooltip-wrapper | `labelClass`& `fieldClass`: Classes that will be added to the label or the outer field `
` |
+| validation | Adds validation icons and error messages to the field. Uses `validators.validation` and `validation.messages` properties. | `showValidation`: `(field: FormlyFieldConfig) => boolean`: optional, used to determine whether to show validation check marks |
+| textarea-description | Adds a description to textarea fields, including the amount of remaining characters. | `maxLength`: Specifies the maximum length to be displayed in the message. `customDescription`: translation key for the textarea description (default: 'textarea.max_limit' ) |
+| description | Adds a custom description to any field | `customDescription`: `string` or `{key: string; args: any}` that will be translated |
+| tooltip | Adds a tooltip to a field. Includes `` component. | `tooltip`: `{ title?: string; text: string; link: string }` that defines the different tooltip texts. |
+| input-addon | Adds a prepended or appended text to a field, e.g. a currency or unit. | `addonLeft?`: `{ text: string \| Observable; }, addonRight?: {text: string \| Observable}` that defines the addon texts. |
### Extensions
diff --git a/src/app/shared/formly/wrappers/textarea-description-wrapper/textarea-description-wrapper.component.ts b/src/app/shared/formly/wrappers/textarea-description-wrapper/textarea-description-wrapper.component.ts
index e8cbfcad79..549aa14f80 100644
--- a/src/app/shared/formly/wrappers/textarea-description-wrapper/textarea-description-wrapper.component.ts
+++ b/src/app/shared/formly/wrappers/textarea-description-wrapper/textarea-description-wrapper.component.ts
@@ -32,8 +32,12 @@ export class TextareaDescriptionWrapperComponent extends FieldWrapper implements
});
}
+ get description() {
+ return this.to.customDescription ?? 'textarea.max_limit';
+ }
+
setDescription(value: string) {
- this.description$ = this.translate.get('textarea.max_limit', {
+ this.description$ = this.translate.get(this.description, {
0: Math.max(0, this.to.maxLength - (value?.length ?? 0)),
});
}