import { handlePixel } from '@alauda/ui';
import { ChangeDetectionStrategy, Component, HostBinding, Input, } from '@angular/core';
import * as i0 from "@angular/core";
const _c0 = function (a0) { return { minHeight: a0 }; };
const _c1 = function (a0) { return { resourceName: a0 }; };
function ZeroStateComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 2);
    i0.ɵɵpipe(1, "pure");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵpipe(4, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", ctx_r0.context)("ngStyle", i0.ɵɵpureFunction1(11, _c0, i0.ɵɵpipeBind2(1, 3, ctx_r0.minHeight, ctx_r0.handlePixel)));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(3, 6, "zero_state_hint", i0.ɵɵpureFunction1(13, _c1, i0.ɵɵpipeBind1(4, 9, ctx_r0.resourceName))), "\n");
} }
export class ZeroStateComponent {
    constructor() {
        this.resourceName = 'data';
        this.zeroState = true;
        this.fetching = false;
        this.context = 'form';
        this.handlePixel = handlePixel;
    }
    get hiddenState() {
        return !this.zeroState && !this.fetching;
    }
}
ZeroStateComponent.ɵfac = function ZeroStateComponent_Factory(t) { return new (t || ZeroStateComponent)(); };
ZeroStateComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ZeroStateComponent, selectors: [["acl-zero-state"]], hostVars: 1, hostBindings: function ZeroStateComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵhostProperty("hidden", ctx.hiddenState);
    } }, inputs: { resourceName: "resourceName", zeroState: "zeroState", fetching: "fetching", context: "context", minHeight: "minHeight" }, decls: 2, vars: 2, consts: [["class", "zero-placeholder", 3, "ngClass", "ngStyle", 4, "ngIf"], [1, "zero-placeholder", 3, "loading"], [1, "zero-placeholder", 3, "ngClass", "ngStyle"]], template: function ZeroStateComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, ZeroStateComponent_div_0_Template, 5, 15, "div", 0);
        i0.ɵɵelement(1, "acl-loading-mask", 1);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", ctx.zeroState && !ctx.fetching);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("loading", ctx.fetching);
    } }, styles: ["[_nghost-%COMP%]  .zero-placeholder{box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:15px 10px;min-height:60px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-placeholder-text));background-color:rgb(var(--aui-color-n-10));border:solid 1px rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);position:sticky;left:0}[_nghost-%COMP%]  .zero-placeholder>aui-icon:first-child{margin-right:var(--aui-spacing-m)}[_nghost-%COMP%]  .aui-table .aui-table__row+.zero-placeholder{border-top-left-radius:0;border-top-right-radius:0}.zero-placeholder.form[_ngcontent-%COMP%]{border:none;padding:14px 0}"], changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ZeroStateComponent, [{
        type: Component,
        args: [{ selector: 'acl-zero-state', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  *ngIf=\"zeroState && !fetching\"\n  class=\"zero-placeholder\"\n  [ngClass]=\"context\"\n  [ngStyle]=\"{\n    minHeight: (minHeight | pure: handlePixel)\n  }\"\n>\n  {{\n    'zero_state_hint' | translate: { resourceName: resourceName | translate }\n  }}\n</div>\n<acl-loading-mask\n  class=\"zero-placeholder\"\n  [loading]=\"fetching\"\n></acl-loading-mask>\n", styles: [":host::ng-deep .zero-placeholder{box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:15px 10px;min-height:60px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-placeholder-text));background-color:rgb(var(--aui-color-n-10));border:solid 1px rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);position:sticky;left:0}:host::ng-deep .zero-placeholder>aui-icon:first-child{margin-right:var(--aui-spacing-m)}:host::ng-deep .aui-table .aui-table__row+.zero-placeholder{border-top-left-radius:0;border-top-right-radius:0}.zero-placeholder.form{border:none;padding:14px 0}\n"] }]
    }], null, { resourceName: [{
            type: Input
        }], zeroState: [{
            type: Input
        }], fetching: [{
            type: Input
        }], context: [{
            type: Input
        }], minHeight: [{
            type: Input
        }], hiddenState: [{
            type: HostBinding,
            args: ['hidden']
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiemVyby1zdGF0ZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvd2lkZ2V0L3plcm8tc3RhdGUvemVyby1zdGF0ZS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvd2lkZ2V0L3plcm8tc3RhdGUvemVyby1zdGF0ZS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBQ3pDLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFdBQVcsRUFDWCxLQUFLLEdBQ04sTUFBTSxlQUFlLENBQUM7Ozs7O0lDTnZCLDhCQU9DOztJQUNDLFlBR0Y7OztJQUFBLGlCQUFNOzs7SUFSSix3Q0FBbUIsb0dBQUE7SUFLbkIsZUFHRjtJQUhFLGlKQUdGOztBREdBLE1BQU0sT0FBTyxrQkFBa0I7SUFOL0I7UUFRRSxpQkFBWSxHQUFHLE1BQU0sQ0FBQztRQUd0QixjQUFTLEdBQUcsSUFBSSxDQUFDO1FBR2pCLGFBQVEsR0FBRyxLQUFLLENBQUM7UUFH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