chore: copia de libs/shared con prefijo Pi y APIs de terceros actualizadas
This commit is contained in:
21
libs/ui/src/lib/util/value/directives/value.directive.ts
Normal file
21
libs/ui/src/lib/util/value/directives/value.directive.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Directive, HostBinding, Input } from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
standalone: false,
|
||||
selector: '[pi-value]',
|
||||
})
|
||||
export class PiValueDirective {
|
||||
@HostBinding('class') get classes(): string | boolean {
|
||||
return ['pi-value', this.value > 0 ? 'is-positive' : 'is-negative'].join(' ');
|
||||
}
|
||||
|
||||
@Input() value!: number;
|
||||
|
||||
checkValue(): string {
|
||||
if (this.value > 0) {
|
||||
return 'is-positive';
|
||||
} else {
|
||||
return 'is-negative';
|
||||
}
|
||||
}
|
||||
}
|
||||
3
libs/ui/src/lib/util/value/index.ts
Normal file
3
libs/ui/src/lib/util/value/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './util-value.module';
|
||||
|
||||
export * from './directives/value.directive';
|
||||
11
libs/ui/src/lib/util/value/util-value.module.ts
Normal file
11
libs/ui/src/lib/util/value/util-value.module.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { PiValueDirective } from './directives/value.directive';
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule],
|
||||
declarations: [PiValueDirective],
|
||||
exports: [PiValueDirective],
|
||||
|
||||
})
|
||||
export class PiSharedUtilValueModule {}
|
||||
Reference in New Issue
Block a user