@alauda-fe/common
Version:
Alauda frontend team common codes.
144 lines • 14.6 kB
JavaScript
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../../../effect-directive/e2e-attribute-binding.directive";
import * as i3 from "../../../../core/pipes/img-theme.pipe";
import * as i4 from "../../../../translate/translate.pipe";
function ResourceNoDataComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
const _r1 = i0.ɵɵgetCurrentView();
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "div", 5);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 6);
i0.ɵɵtext(5);
i0.ɵɵpipe(6, "translate");
i0.ɵɵelementStart(7, "a", 7);
i0.ɵɵlistener("click", function ResourceNoDataComponent_ng_container_5_Template_a_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.refresh.emit()); });
i0.ɵɵtext(8);
i0.ɵɵpipe(9, "translate");
i0.ɵɵelementEnd();
i0.ɵɵtext(10);
i0.ɵɵpipe(11, "translate");
i0.ɵɵelementStart(12, "a", 7);
i0.ɵɵlistener("click", function ResourceNoDataComponent_ng_container_5_Template_a_click_12_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.clear.emit()); });
i0.ɵɵtext(13);
i0.ɵɵpipe(14, "translate");
i0.ɵɵelementEnd()();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 5, "resource_not_found_title"), " ");
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 7, "resource_not_found_des_pre"), " ");
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 9, "refresh"));
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(11, 11, "or"), " ");
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(14, 13, "clear_filter"));
} }
function ResourceNoDataComponent_ng_container_6_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "div", 5);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 6);
i0.ɵɵtext(5);
i0.ɵɵpipe(6, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "no_namespace"));
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 4, "no_namespace_tip"), " ");
} }
function ResourceNoDataComponent_ng_container_6_ng_container_2_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "div", 5);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 6);
i0.ɵɵtext(5);
i0.ɵɵpipe(6, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "no_project"));
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "no_project_tip"));
} }
function ResourceNoDataComponent_ng_container_6_ng_container_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "div", 5);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 6);
i0.ɵɵtext(5);
i0.ɵɵpipe(6, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "no_cluster"));
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "no_cluster_tip"));
} }
function ResourceNoDataComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵtemplate(1, ResourceNoDataComponent_ng_container_6_ng_container_1_Template, 7, 6, "ng-container", 4)(2, ResourceNoDataComponent_ng_container_6_ng_container_2_Template, 7, 6, "ng-container", 4)(3, ResourceNoDataComponent_ng_container_6_ng_container_3_Template, 7, 6, "ng-container", 4);
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
const ctx_r1 = i0.ɵɵnextContext();
i0.ɵɵadvance();
i0.ɵɵproperty("ngIf", ctx_r1.type === "namespace");
i0.ɵɵadvance();
i0.ɵɵproperty("ngIf", ctx_r1.type === "project");
i0.ɵɵadvance();
i0.ɵɵproperty("ngIf", ctx_r1.type === "cluster");
} }
export class ResourceNoDataComponent {
constructor() {
this.isFiltered = false;
this.type = 'namespace';
this.refresh = new EventEmitter();
this.clear = new EventEmitter();
}
static { this.ɵfac = function ResourceNoDataComponent_Factory(t) { return new (t || ResourceNoDataComponent)(); }; }
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ResourceNoDataComponent, selectors: [["acl-resource-no-data"]], inputs: { isFiltered: "isFiltered", type: "type" }, outputs: { refresh: "refresh", clear: "clear" }, decls: 7, vars: 5, consts: [[1, "no-data"], [1, "no-data__figure"], [3, "src"], [1, "no-data__text"], [4, "ngIf"], [1, "no-data__title"], [1, "no-data__des"], ["href", "javascript:;", 3, "click"]], template: function ResourceNoDataComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
i0.ɵɵelement(2, "img", 2);
i0.ɵɵpipe(3, "aclImageTheme");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 3);
i0.ɵɵtemplate(5, ResourceNoDataComponent_ng_container_5_Template, 15, 15, "ng-container", 4)(6, ResourceNoDataComponent_ng_container_6_Template, 4, 3, "ng-container", 4);
i0.ɵɵelementEnd()();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵproperty("src", i0.ɵɵpipeBind1(3, 3, "images/$theme/no-data.svg"), i0.ɵɵsanitizeUrl);
i0.ɵɵadvance(3);
i0.ɵɵproperty("ngIf", ctx.isFiltered);
i0.ɵɵadvance();
i0.ɵɵproperty("ngIf", !ctx.isFiltered);
} }, dependencies: [i1.NgIf, i2.E2eAttributeBindingDirective, i3.ImgThemePipe, i4.TranslatePipe], styles: [".no-data[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;height:100%;justify-content:center;text-align:center}.no-data__figure[_ngcontent-%COMP%], .no-data__figure[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:160px}.no-data__title[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-1));font-size:18px;font-weight:500;margin:20px 0 12px}.no-data__des[_ngcontent-%COMP%]{font-size:14px;color:rgb(var(--aui-color-n-4))}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ResourceNoDataComponent, [{
type: Component,
args: [{ selector: 'acl-resource-no-data', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"no-data\">\n <div class=\"no-data__figure\">\n <img [src]=\"'images/$theme/no-data.svg' | aclImageTheme\" />\n </div>\n <div class=\"no-data__text\">\n <ng-container *ngIf=\"isFiltered\">\n <div class=\"no-data__title\">\n {{ 'resource_not_found_title' | translate }}\n </div>\n <div class=\"no-data__des\">\n {{ 'resource_not_found_des_pre' | translate }}\n <a\n href=\"javascript:;\"\n (click)=\"refresh.emit()\"\n >{{ 'refresh' | translate }}</a\n >\n {{ 'or' | translate }}\n <a\n href=\"javascript:;\"\n (click)=\"clear.emit()\"\n >{{ 'clear_filter' | translate }}</a\n >\n </div>\n </ng-container>\n <ng-container *ngIf=\"!isFiltered\">\n <ng-container *ngIf=\"type === 'namespace'\">\n <div class=\"no-data__title\">{{ 'no_namespace' | translate }}</div>\n <div class=\"no-data__des\">\n {{ 'no_namespace_tip' | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"type === 'project'\"\n ><div class=\"no-data__title\">{{ 'no_project' | translate }}</div>\n <div class=\"no-data__des\">{{ 'no_project_tip' | translate }}</div>\n </ng-container>\n <ng-container *ngIf=\"type === 'cluster'\"\n ><div class=\"no-data__title\">{{ 'no_cluster' | translate }}</div>\n <div class=\"no-data__des\">{{ 'no_cluster_tip' | translate }}</div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [".no-data{display:flex;align-items:center;flex-direction:column;height:100%;justify-content:center;text-align:center}.no-data__figure,.no-data__figure img{height:160px}.no-data__title{color:rgb(var(--aui-color-n-1));font-size:18px;font-weight:500;margin:20px 0 12px}.no-data__des{font-size:14px;color:rgb(var(--aui-color-n-4))}\n"] }]
}], null, { isFiltered: [{
type: Input
}], type: [{
type: Input
}], refresh: [{
type: Output
}], clear: [{
type: Output
}] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ResourceNoDataComponent, { className: "ResourceNoDataComponent" }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL2J1c2luZXNzL3Jlc291cmNlLXNlbGVjdC9pbnRlcm5hbHMvbm8tZGF0YS9jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vb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