UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

75 lines 9.19 kB
import { IconModule } from '@alauda/ui'; import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, HostBinding, Input, } from '@angular/core'; import { EffectDirectiveModule } from '../../effect-directive/module'; import { TranslateModule } from '../../translate/public-api'; import * as i0 from "@angular/core"; import * as i1 from "@alauda/ui"; import * as i2 from "../../translate/translate.pipe"; function LoadingMaskComponent_div_0_ng_container_3_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainerStart(0); i0.ɵɵtext(1); i0.ɵɵelementContainerEnd(); } if (rf & 2) { const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵadvance(); i0.ɵɵtextInterpolate1(" ", ctx_r0.text, " "); } } function LoadingMaskComponent_div_0_ng_container_4_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainerStart(0); i0.ɵɵtext(1); i0.ɵɵpipe(2, "translate"); i0.ɵɵelementContainerEnd(); } if (rf & 2) { i0.ɵɵadvance(); i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "loading_please_wait"), " "); } } function LoadingMaskComponent_div_0_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "div"); i0.ɵɵelement(1, "aui-icon", 1); i0.ɵɵelementStart(2, "span", 2); i0.ɵɵtemplate(3, LoadingMaskComponent_div_0_ng_container_3_Template, 2, 1, "ng-container", 3)(4, LoadingMaskComponent_div_0_ng_container_4_Template, 3, 3, "ng-container", 3); i0.ɵɵelementEnd()(); } if (rf & 2) { const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵclassMapInterpolate1("acl-loading-mask acl-loading-mask--", ctx_r0.type, ""); i0.ɵɵadvance(3); i0.ɵɵproperty("ngIf", ctx_r0.text); i0.ɵɵadvance(); i0.ɵɵproperty("ngIf", !ctx_r0.text); } } /** * A simple loading mask component which will show a spinner * when loading attribute is true. */ export class LoadingMaskComponent { constructor() { this.type = 'content'; } get hidden() { return !this.loading; } static { this.ɵfac = function LoadingMaskComponent_Factory(t) { return new (t || LoadingMaskComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadingMaskComponent, selectors: [["acl-loading-mask"]], hostVars: 1, hostBindings: function LoadingMaskComponent_HostBindings(rf, ctx) { if (rf & 2) { i0.ɵɵhostProperty("hidden", ctx.hidden); } }, inputs: { loading: "loading", type: "type", text: "text" }, standalone: true, features: [i0.ɵɵStandaloneFeature], decls: 1, vars: 1, consts: [[3, "class", 4, "ngIf"], ["icon", "spinner", "margin", "right", 1, "acl-loading-mask__icon"], [1, "acl-loading-mask__text"], [4, "ngIf"]], template: function LoadingMaskComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, LoadingMaskComponent_div_0_Template, 5, 5, "div", 0); } if (rf & 2) { i0.ɵɵproperty("ngIf", ctx.loading); } }, dependencies: [NgIf, IconModule, i1.IconComponent, TranslateModule, i2.TranslatePipe, EffectDirectiveModule], styles: ["[_nghost-%COMP%]{display:block}.acl-loading-mask[_ngcontent-%COMP%]{font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);font-weight:var(--aui-font-weight-normal);color:rgb(var(--aui-color-help-text));display:flex;justify-content:center}.acl-loading-mask__icon[_ngcontent-%COMP%]{font-size:var(--aui-icon-size-m);color:rgb(var(--aui-color-primary))}.acl-loading-mask--module[_ngcontent-%COMP%]{height:80px;background:unset;flex-direction:column;align-items:center;border:unset}.acl-loading-mask--module[_ngcontent-%COMP%] .acl-loading-mask__icon[_ngcontent-%COMP%]{display:inline-flex;font-size:32px;margin-bottom:16px}.acl-loading-mask--module[_ngcontent-%COMP%] .acl-loading-mask__text[_ngcontent-%COMP%]{font-size:18px}"], changeDetection: 0 }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingMaskComponent, [{ type: Component, args: [{ selector: 'acl-loading-mask', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf, IconModule, TranslateModule, EffectDirectiveModule], standalone: true, template: "<div\n class=\"acl-loading-mask acl-loading-mask--{{ type }}\"\n *ngIf=\"loading\"\n>\n <aui-icon\n class=\"acl-loading-mask__icon\"\n icon=\"spinner\"\n margin=\"right\"\n ></aui-icon>\n <span class=\"acl-loading-mask__text\">\n <ng-container *ngIf=\"text\">\n {{ text }}\n </ng-container>\n <ng-container *ngIf=\"!text\">\n {{ 'loading_please_wait' | translate }}\n </ng-container>\n </span>\n</div>\n", styles: [":host{display:block}.acl-loading-mask{font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);font-weight:var(--aui-font-weight-normal);color:rgb(var(--aui-color-help-text));display:flex;justify-content:center}.acl-loading-mask__icon{font-size:var(--aui-icon-size-m);color:rgb(var(--aui-color-primary))}.acl-loading-mask--module{height:80px;background:unset;flex-direction:column;align-items:center;border:unset}.acl-loading-mask--module .acl-loading-mask__icon{display:inline-flex;font-size:32px;margin-bottom:16px}.acl-loading-mask--module .acl-loading-mask__text{font-size:18px}\n"] }] }], null, { loading: [{ type: Input }], type: [{ type: Input }], text: [{ type: Input }], hidden: [{ type: HostBinding, args: ['hidden'] }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LoadingMaskComponent, { className: "LoadingMaskComponent" }); })(); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy1tYXNrLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tbW9uL3NyYy93aWRnZXQvbG9hZGluZy1tYXNrL2xvYWRpbmctbWFzay5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvd2lkZ2V0L2xvYWRpbmctbWFzay9sb2FkaW5nLW1hc2suY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW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