@clemledev/clemledev-core
Version:
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
174 lines (165 loc) • 8.22 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component, Injectable, HostListener, Directive, Pipe, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import moment from 'moment';
class ButtonComponent {
fill = '';
color = 'primary';
rounded = null;
expand = ''; // 'block' : Fills the parent div
mode = 'ios';
shape = '';
disabled = false;
type = 'text';
size = 'default';
btnClass = '';
onClick = new EventEmitter();
isLoading = false;
constructor() {
// this.loadingService.loading$.subscribe((loading) => {
// this.isLoading = loading;
// });
}
ngOnInit() {
}
onClickButton(event) {
this.onClick.emit(event);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: ButtonComponent, isStandalone: false, selector: "cld-button", inputs: { fill: "fill", color: "color", rounded: "rounded", expand: "expand", mode: "mode", shape: "shape", disabled: "disabled", type: "type", size: "size", btnClass: "btnClass" }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<!-- <ion-button [class]=\"btnClass\" [fill]=\"fill != '' ? fill : undefined\" [color]=\"color ? color : undefined\" mode=\"ios\"\n [shape]=\"shape != '' ? shape : undefined\" [disabled]=\"isLoading || disabled\" [type]=\"type\" [size]=\"size\" [expand]=\"expand\"\n (click)=\"onClickButton($event)\">\n <ng-content></ng-content>\n</ion-button> -->", styles: [""] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ButtonComponent, decorators: [{
type: Component,
args: [{ selector: 'cld-button', standalone: false, template: "<!-- <ion-button [class]=\"btnClass\" [fill]=\"fill != '' ? fill : undefined\" [color]=\"color ? color : undefined\" mode=\"ios\"\n [shape]=\"shape != '' ? shape : undefined\" [disabled]=\"isLoading || disabled\" [type]=\"type\" [size]=\"size\" [expand]=\"expand\"\n (click)=\"onClickButton($event)\">\n <ng-content></ng-content>\n</ion-button> -->" }]
}], ctorParameters: () => [], propDecorators: { fill: [{
type: Input
}], color: [{
type: Input
}], rounded: [{
type: Input
}], expand: [{
type: Input
}], mode: [{
type: Input
}], shape: [{
type: Input
}], disabled: [{
type: Input
}], type: [{
type: Input
}], size: [{
type: Input
}], btnClass: [{
type: Input
}], onClick: [{
type: Output
}] } });
class OutilsService {
parseFloatAndRound(value) {
const parsed = parseFloat(value);
return isNaN(parsed) ? null : Math.round(parsed * 100) / 100;
}
tsToDate(timestamp) {
return new Date(timestamp);
}
dateToTs(date) {
return date.getTime();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OutilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OutilsService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OutilsService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}] });
class HighlightDirective {
el;
renderer;
cldHighlight = 'yellow';
constructor(el, renderer) {
this.el = el;
this.renderer = renderer;
}
onMouseEnter() {
this.renderer.setStyle(this.el.nativeElement, 'backgroundColor', this.cldHighlight);
}
onMouseLeave() {
this.renderer.removeStyle(this.el.nativeElement, 'backgroundColor');
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: HighlightDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: HighlightDirective, isStandalone: false, selector: "[cldHighlight]", inputs: { cldHighlight: "cldHighlight" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: HighlightDirective, decorators: [{
type: Directive,
args: [{
selector: '[cldHighlight]',
standalone: false
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { cldHighlight: [{
type: Input
}], onMouseEnter: [{
type: HostListener,
args: ['mouseenter']
}], onMouseLeave: [{
type: HostListener,
args: ['mouseleave']
}] } });
class TimestampPipe {
transform(value, format = 'short') {
if (!value)
return '';
return moment(value).format(format === 'short' ? 'DD/MM/YYYY' : 'DD/MM/YYYY HH:mm:ss');
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TimestampPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: TimestampPipe, isStandalone: false, name: "timestamp" });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TimestampPipe, decorators: [{
type: Pipe,
args: [{
name: 'timestamp',
standalone: false
}]
}] });
// import { ClemledevCoreComponent } from './clemledev-core.component';
class ClemledevCoreModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ClemledevCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: ClemledevCoreModule, declarations: [ButtonComponent,
HighlightDirective,
TimestampPipe], imports: [CommonModule], exports: [ButtonComponent,
HighlightDirective,
TimestampPipe] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ClemledevCoreModule, providers: [OutilsService], imports: [CommonModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: ClemledevCoreModule, decorators: [{
type: NgModule,
args: [{
declarations: [
ButtonComponent,
HighlightDirective,
TimestampPipe
],
imports: [
CommonModule,
// IonicModule
],
exports: [
ButtonComponent,
HighlightDirective,
TimestampPipe
],
providers: [OutilsService]
}]
}] });
/*
* Public API Surface of clemledev-core
*/
// export * from './lib/clemledev-core.service';
// export * from './lib/clemledev-core.component';
// export * from './lib/clemledev-core.module';
/**
* Generated bundle index. Do not edit.
*/
export { ButtonComponent, ClemledevCoreModule, HighlightDirective, OutilsService, TimestampPipe };
//# sourceMappingURL=clemledev-clemledev-core.mjs.map