UNPKG

hslayers-ng

Version:
86 lines (82 loc) 3.3 kB
import * as i1 from '@angular/common'; import { CommonModule } from '@angular/common'; import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import { TranslatePipe } from '@ngx-translate/core'; class HsAddToMapButtonComponent { constructor() { /** * Translation string to be used as title */ this.title = 'COMMON.addToMap'; this.loading = false; this.add = new EventEmitter(); } /** * Emit add event to trigger bind action */ addLayer() { this.add.emit(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: HsAddToMapButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: HsAddToMapButtonComponent, isStandalone: true, selector: "hs-add-to-map", inputs: { disabled: "disabled", title: "title", loading: "loading", classes: "classes" }, outputs: { add: "add" }, ngImport: i0, template: ` <button class="btn btn-primary w-100" [disabled]="disabled" [title]="title | translate" (click)="addLayer()" [ngClass]="classes" > @if (!loading) { <span class="d-flex justify-content-center align-items-baseline gap-1"> <i class="fa-solid fa-plus"> </i>{{ 'COMMON.addToMap' | translate }} </span> } @else { <span> <span class="hs-loader"></span>&emsp; {{ 'COMMON.uploading' | translate }} </span> } <ng-content></ng-content> </button> `, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: HsAddToMapButtonComponent, decorators: [{ type: Component, args: [{ selector: 'hs-add-to-map', template: ` <button class="btn btn-primary w-100" [disabled]="disabled" [title]="title | translate" (click)="addLayer()" [ngClass]="classes" > @if (!loading) { <span class="d-flex justify-content-center align-items-baseline gap-1"> <i class="fa-solid fa-plus"> </i>{{ 'COMMON.addToMap' | translate }} </span> } @else { <span> <span class="hs-loader"></span>&emsp; {{ 'COMMON.uploading' | translate }} </span> } <ng-content></ng-content> </button> `, imports: [CommonModule, TranslatePipe], styles: [":host{display:block}\n"] }] }], ctorParameters: () => [], propDecorators: { disabled: [{ type: Input }], title: [{ type: Input }], loading: [{ type: Input }], classes: [{ type: Input }], add: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { HsAddToMapButtonComponent }; //# sourceMappingURL=hslayers-ng-common-add-to-map.mjs.map