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,40 @@
import { Directive, ElementRef, HostBinding, Input, OnInit, Renderer2 } from '@angular/core';
import { unit } from '../models';
@Directive()
export abstract class PiBaseAffixDirective implements OnInit {
@HostBinding('class') get classes(): string {
return ['pi-affix', `pi-affix__appearance--${this.appearance}`].join(' ');
}
@Input() unit: unit | string | undefined;
@Input() appearance: 'ghost' | 'fill' = 'ghost';
constructor(private renderer: Renderer2, private el: ElementRef) {}
ngOnInit() {
if (this.unit) {
const span = this.renderer.createElement('span');
const text = this.renderer.createText(this.unit);
this.renderer.appendChild(span, text);
this.renderer.appendChild(this.el.nativeElement, span);
}
}
}
@Directive({
standalone: false,
selector: 'pi-prefix',
})
export class PiPrefixDirective extends PiBaseAffixDirective {
@HostBinding('class') className = 'pi-affix__prefix';
}
@Directive({
standalone: false,
selector: 'pi-suffix',
})
export class PiSuffixDirective extends PiBaseAffixDirective {
@HostBinding('class') className = 'pi-affix__suffix';
}