UNPKG

moh-common-lib

Version:

A library of Angular components, services, and styles for B.C. Government Ministry of Health (MoH).

55 lines 5.29 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, Input } from '@angular/core'; import { Base } from '../../models/base'; /** @enum {string} */ const ApiStatusCodes = { SUCCESS: '0', ERROR: '1', WARNING: '2', }; export { ApiStatusCodes }; export class ConfirmTemplateComponent extends Base { constructor() { super(); this.displayIcon = ApiStatusCodes.SUCCESS; } // Status codes /** * @return {?} */ get successCode() { return ApiStatusCodes.SUCCESS; } /** * @return {?} */ get errorCode() { return ApiStatusCodes.ERROR; } /** * @return {?} */ get warningCode() { return ApiStatusCodes.WARNING; } } ConfirmTemplateComponent.decorators = [ { type: Component, args: [{ selector: 'common-confirm-template', template: "<ng-content select=\"[confirmationTitle]\"></ng-content>\r\n<common-page-section layout='noTips'>\r\n\r\n <!-- Icons and confirmation messages -->\r\n <div [ngSwitch]=\"displayIcon\">\r\n <ng-container *ngSwitchCase=\"successCode\">\r\n <div class=\"message-container border-success\">\r\n <p class=\"confirm-icon--success\">\r\n <i class=\"fa fa-2x fa-check-circle text-success pr-2\" aria-label=\"success\"></i>\r\n </p>\r\n <ng-container *ngTemplateOutlet=\"message\"></ng-container>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"errorCode\">\r\n <div class=\"message-container border-danger\">\r\n <p class=\"confirm-icon--error\">\r\n <i class=\"fa fa-2x fa-exclamation-triangle text-danger pr-2\" aria-label=\"error\"></i>\r\n </p>\r\n <ng-container *ngTemplateOutlet=\"message\"></ng-container>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"warningCode\">\r\n <div class=\"message-container border-warning\">\r\n <p class=\"confirm-icon--warning\">\r\n <i class=\"fa fa-2x fa-exclamation-circle text-warning pr-2\" aria-label=\"warning\"></i>\r\n </p>\r\n <ng-container *ngTemplateOutlet=\"message\"></ng-container>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</common-page-section>\r\n\r\n<ng-content select=\"[AdditionalInfo]\"></ng-content>\r\n\r\n<ng-template #message>\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [".message-container{display:flex;padding:1rem;min-height:50px;border-style:solid;border-width:3px!important;font-size:1.25rem}@media (max-width:767.98px){.message-container{height:auto;margin:initial}}.confirm-icon--error::after,.confirm-icon--success::after,.confirm-icon--warning::after{font-size:1.5rem;margin-left:.5rem}"] }] } ]; /** @nocollapse */ ConfirmTemplateComponent.ctorParameters = () => []; ConfirmTemplateComponent.propDecorators = { displayIcon: [{ type: Input }] }; if (false) { /** @type {?} */ ConfirmTemplateComponent.prototype.displayIcon; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS10ZW1wbGF0ZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9tb2gtY29tbW9uLWxpYi8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL2NvbmZpcm0tdGVtcGxhdGUvY29uZmlybS10ZW1wbGF0ZS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQzs7O0lBSXZDLFNBQVUsR0FBRztJQUNiLE9BQVEsR0FBRztJQUNYLFNBQVUsR0FBRzs7O0FBUWYsTUFBTSxPQUFPLHdCQUF5QixTQUFRLElBQUk7SUFJaEQ7UUFDRSxLQUFLLEVBQUUsQ0FBQztRQUhELGdCQUFXLEdBQW1CLGNBQWMsQ0FBQyxPQUFPLENBQUM7SUFJOUQsQ0FBQzs7Ozs7SUFHRCxJQUFJLFdBQVc7UUFDYixPQUFPLGNBQWMsQ0FBQyxPQUF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