UNPKG

@koalarx/ui

Version:

Koala UI is a Design System developed in Angular whose objective is to facilitate and make your development faster and simpler, making this framework your greatest ally.

94 lines (88 loc) 7.91 kB
import * as i0 from '@angular/core'; import { Component, ChangeDetectionStrategy, Inject, Injectable, NgModule } from '@angular/core'; import * as i3 from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; import { KoalaLanguageHelper } from '@koalarx/ui/core'; import * as i1 from '@angular/common'; import { CommonModule } from '@angular/common'; import * as i2 from '@koalarx/ui/dynamic-component'; import { KoalaDynamicComponentModule } from '@koalarx/ui/dynamic-component'; import * as i4 from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button'; import * as i5 from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon'; import * as i1$1 from '@koalarx/ui/dialog'; class DialogQuestionComponent { constructor(config) { this.config = config; this.languageHelper = KoalaLanguageHelper; } } DialogQuestionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogQuestionComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); DialogQuestionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DialogQuestionComponent, selector: "ng-component", ngImport: i0, template: "<div mat-dialog-content>\n <div class=\"question\">\n\t <koala-dynamic-component\n\t\t *ngIf=\"config.avatar else notHaveAvatar\"\n\t\t [dynamicComponent]=\"config.avatar\">\n\t </koala-dynamic-component>\n\t <ng-template #notHaveAvatar>\n <mat-icon>help</mat-icon>\n\t </ng-template>\n <p [innerHTML]=\"config.message\" class=\"alert-message text-center\"></p>\n </div>\n</div>\n<div align=\"center\" mat-dialog-actions>\n <button [mat-dialog-close]=\"{question: true}\" color=\"primary\" class=\"outline\" mat-button>{{languageHelper.getYesMessage()}}</button>\n <button [mat-dialog-close]=\"{question: false}\" color=\"warn\" class=\"outline\" mat-button>{{languageHelper.getNoMessage()}}</button>\n</div>\n", styles: [".question{color:#616161}.question .alert-message{font-family:OpenSans,sans-serif;margin:20px auto 10px!important}.question mat-icon{position:relative;display:block;margin:15px auto;width:60px;height:60px;font-size:60px;color:#1565c0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.KoalaDynamicComponentFactory, selector: "koala-dynamic-component", inputs: ["dynamicComponent"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogQuestionComponent, decorators: [{ type: Component, args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<div mat-dialog-content>\n <div class=\"question\">\n\t <koala-dynamic-component\n\t\t *ngIf=\"config.avatar else notHaveAvatar\"\n\t\t [dynamicComponent]=\"config.avatar\">\n\t </koala-dynamic-component>\n\t <ng-template #notHaveAvatar>\n <mat-icon>help</mat-icon>\n\t </ng-template>\n <p [innerHTML]=\"config.message\" class=\"alert-message text-center\"></p>\n </div>\n</div>\n<div align=\"center\" mat-dialog-actions>\n <button [mat-dialog-close]=\"{question: true}\" color=\"primary\" class=\"outline\" mat-button>{{languageHelper.getYesMessage()}}</button>\n <button [mat-dialog-close]=\"{question: false}\" color=\"warn\" class=\"outline\" mat-button>{{languageHelper.getNoMessage()}}</button>\n</div>\n", styles: [".question{color:#616161}.question .alert-message{font-family:OpenSans,sans-serif;margin:20px auto 10px!important}.question mat-icon{position:relative;display:block;margin:15px auto;width:60px;height:60px;font-size:60px;color:#1565c0}\n"] }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA] }] }]; } }); class KoalaQuestionService { constructor(dialogService) { this.dialogService = dialogService; } open(config, yesCallback, noCallback) { this.dialogService.open(DialogQuestionComponent, 'auto', config, {}, (answer) => { if (answer.question && yesCallback) { yesCallback(); } else if (!answer.question && noCallback) { noCallback(); } }); } } KoalaQuestionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionService, deps: [{ token: i1$1.KoalaDialogService }], target: i0.ɵɵFactoryTarget.Injectable }); KoalaQuestionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionService, providedIn: "any" }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionService, decorators: [{ type: Injectable, args: [{ providedIn: "any" }] }], ctorParameters: function () { return [{ type: i1$1.KoalaDialogService }]; } }); class KoalaQuestionModule { } KoalaQuestionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); KoalaQuestionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionModule, declarations: [DialogQuestionComponent], imports: [CommonModule, KoalaDynamicComponentModule, MatDialogModule, MatButtonModule, MatIconModule], exports: [DialogQuestionComponent] }); KoalaQuestionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionModule, imports: [CommonModule, KoalaDynamicComponentModule, MatDialogModule, MatButtonModule, MatIconModule] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KoalaQuestionModule, decorators: [{ type: NgModule, args: [{ declarations: [ DialogQuestionComponent ], imports: [ CommonModule, KoalaDynamicComponentModule, MatDialogModule, MatButtonModule, MatIconModule ], exports: [ DialogQuestionComponent ] }] }] }); /** * Generated bundle index. Do not edit. */ export { DialogQuestionComponent, KoalaQuestionModule, KoalaQuestionService }; //# sourceMappingURL=koalarx-ui-question.mjs.map