chore: copia de libs/shared con prefijo Pi y APIs de terceros actualizadas

This commit is contained in:
2026-07-27 21:14:48 +02:00
parent 0758b00d54
commit 771d83c0aa
672 changed files with 47352 additions and 4692 deletions

View File

@@ -0,0 +1,52 @@
import { Injectable, Injector } from '@angular/core';
import { ControlContainer, ControlValueAccessor } from '@angular/forms';
@Injectable()
export class PiFormControl implements ControlValueAccessor {
value: number | string | Array<string> | boolean;
onChange = (value: number | string | Array<string> | boolean) => {};
onTouched = () => {};
disabled = false;
focused = false;
touched = false;
constructor(protected injector: Injector) {}
get controlContainer(): any {
return this.injector.get(ControlContainer);
}
writeValue(value: number | string | Array<string> | boolean) {
this.value = value;
}
registerOnChange(onChange: any) {
this.onChange = onChange;
}
registerOnTouched(onTouched: any) {
this.onTouched = onTouched;
}
markAsTouched() {
if (!this.touched) {
this.onTouched();
this.touched = true;
}
}
setDisabledState(disabled: boolean) {
this.disabled = disabled;
}
onFocus(): void {
this.focused = true;
}
onBlur(): void {
this.focused = false;
}
}