UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

113 lines (112 loc) 11 kB
import { ChangeDetectionStrategy, Component, Input, TemplateRef, } from '@angular/core'; import * as i0 from "@angular/core"; const _c0 = () => []; const _c1 = a0 => ({ data: a0 }); function LegendDropdownComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainerStart(0); i0.ɵɵelement(1, "aui-icon", 4); i0.ɵɵelementContainerEnd(); } if (rf & 2) { i0.ɵɵnextContext(); const dropdownItemTemplate_r1 = i0.ɵɵreference(4); i0.ɵɵadvance(); i0.ɵɵproperty("auiTooltip", dropdownItemTemplate_r1)("auiTooltipContext", i0.ɵɵpureFunction1(3, _c1, i0.ɵɵpureFunction0(2, _c0))); } } function LegendDropdownComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "button", 5); i0.ɵɵelement(1, "aui-icon", 6); i0.ɵɵelementEnd(); } if (rf & 2) { i0.ɵɵnextContext(); const dropdownItemTemplate_r1 = i0.ɵɵreference(4); i0.ɵɵproperty("square", true)("auiTooltip", dropdownItemTemplate_r1)("auiTooltipContext", i0.ɵɵpureFunction1(4, _c1, i0.ɵɵpureFunction0(3, _c0))); } } function LegendDropdownComponent_ng_template_3_ng_container_0_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainerStart(0); i0.ɵɵelementStart(1, "div", 7); i0.ɵɵelementContainer(2, 8); i0.ɵɵelementEnd(); i0.ɵɵelementContainerEnd(); } if (rf & 2) { const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵadvance(2); i0.ɵɵproperty("ngTemplateOutlet", ctx_r1.legendTemplate); } } function LegendDropdownComponent_ng_template_3_ng_template_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "span", 9); i0.ɵɵtext(1); i0.ɵɵpipe(2, "translate"); i0.ɵɵelementEnd(); } if (rf & 2) { i0.ɵɵadvance(); i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "no_data")); } } function LegendDropdownComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, LegendDropdownComponent_ng_template_3_ng_container_0_Template, 3, 1, "ng-container", 3)(1, LegendDropdownComponent_ng_template_3_ng_template_1_Template, 3, 3, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor); } if (rf & 2) { const noDataTemplate_r3 = i0.ɵɵreference(2); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵproperty("ngIf", ctx_r1.data.length && !ctx_r1.noData)("ngIfElse", noDataTemplate_r3); } } export class LegendDropdownComponent { static { this.ɵfac = function LegendDropdownComponent_Factory(t) { return new (t || LegendDropdownComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LegendDropdownComponent, selectors: [["acl-view-legend-dropdown"]], inputs: { data: "data", legendTemplate: "legendTemplate", noData: "noData", isCard: "isCard" }, decls: 5, vars: 2, consts: [["elseTemplate", ""], ["dropdownItemTemplate", ""], ["noDataTemplate", ""], [4, "ngIf", "ngIfElse"], ["icon", "prod:chart_legend", "auiTooltipType", "info", "auiTooltipPosition", "bottom end", "auiTooltipTrigger", "click", "auiTooltipActive", "legendActive", 1, "btn", 3, "auiTooltip", "auiTooltipContext"], ["aui-button", "", "icon", "prod:chart_legend", "auiTooltipType", "info", "auiTooltipPosition", "bottom end", "auiTooltipTrigger", "click", "auiTooltipActive", "legendActive", 1, "btn", 3, "square", "auiTooltip", "auiTooltipContext"], ["icon", "prod:chart_legend"], [1, "legend-vertical"], [3, "ngTemplateOutlet"], [1, "no-data"]], template: function LegendDropdownComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, LegendDropdownComponent_ng_container_0_Template, 2, 5, "ng-container", 3)(1, LegendDropdownComponent_ng_template_1_Template, 2, 6, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(3, LegendDropdownComponent_ng_template_3_Template, 3, 2, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor); } if (rf & 2) { const elseTemplate_r4 = i0.ɵɵreference(2); i0.ɵɵproperty("ngIf", !ctx.isCard)("ngIfElse", elseTemplate_r4); } }, styles: [".btn[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-2));cursor:pointer} .legend-label{padding:0;margin:0;list-style:none;display:flex;align-items:center;cursor:pointer;justify-content:flex-start} .legend-label:not(:last-child){margin-bottom:8px} .label-name{flex:1;color:rgb(var(--aui-color-secondary-text));overflow:hidden;word-wrap:normal;text-overflow:ellipsis} .label-symbol{margin-right:4px}[_nghost-%COMP%] .legend-labels[_ngcontent-%COMP%]{padding:0;margin:0;list-style:none;display:flex;flex-direction:column}.legendActive[_ngcontent-%COMP%]{color:rgb(var(--aui-color-primary))}.no-data[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-4));font-size:14px}"], changeDetection: 0 }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LegendDropdownComponent, [{ type: Component, args: [{ selector: 'acl-view-legend-dropdown', template: ` <ng-container *ngIf="!isCard; else elseTemplate"> <aui-icon class="btn" icon="prod:chart_legend" [auiTooltip]="dropdownItemTemplate" [auiTooltipContext]="{ data: [] }" auiTooltipType="info" auiTooltipPosition="bottom end" auiTooltipTrigger="click" auiTooltipActive="legendActive" ></aui-icon> </ng-container> <ng-template #elseTemplate> <button aui-button [square]="true" class="btn" icon="prod:chart_legend" [auiTooltip]="dropdownItemTemplate" [auiTooltipContext]="{ data: [] }" auiTooltipType="info" auiTooltipPosition="bottom end" auiTooltipTrigger="click" auiTooltipActive="legendActive" > <aui-icon icon="prod:chart_legend"></aui-icon> </button> </ng-template> <ng-template #dropdownItemTemplate> <ng-container *ngIf="data.length && !noData; else noDataTemplate"> <div class="legend-vertical"> <ng-container [ngTemplateOutlet]="legendTemplate"></ng-container> </div> </ng-container> <ng-template #noDataTemplate> <span class="no-data">{{ 'no_data' | translate }}</span> </ng-template> </ng-template> `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".btn{color:rgb(var(--aui-color-n-2));cursor:pointer}::ng-deep .legend-label{padding:0;margin:0;list-style:none;display:flex;align-items:center;cursor:pointer;justify-content:flex-start}::ng-deep .legend-label:not(:last-child){margin-bottom:8px}::ng-deep .label-name{flex:1;color:rgb(var(--aui-color-secondary-text));overflow:hidden;word-wrap:normal;text-overflow:ellipsis}::ng-deep .label-symbol{margin-right:4px}:host .legend-labels{padding:0;margin:0;list-style:none;display:flex;flex-direction:column}.legendActive{color:rgb(var(--aui-color-primary))}.no-data{color:rgb(var(--aui-color-n-4));font-size:14px}\n"] }] }], null, { data: [{ type: Input }], legendTemplate: [{ type: Input }], noData: [{ type: Input }], isCard: [{ type: Input }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LegendDropdownComponent, { className: "LegendDropdownComponent" }); })(); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tbGVnZW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3ZpZXctemNoYXJ0L2N1c3RvbS10ZW1wbGF0ZS9kcm9wZG93bi1sZWdlbmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsS0FBSyxFQUNMLFdBQVcsR0FDWixNQUFNLGVBQWUsQ0FBQzs7Ozs7SUFPbkIsNkJBQWlEO0lBQy9DLDhCQVNZOzs7OztJQU5WLGNBQW1DO0lBQ25DLEFBREEsb0RBQW1DLDZFQUNEOzs7SUFRcEMsaUNBV0M7SUFDQyw4QkFBOEM7SUFDaEQsaUJBQVM7Ozs7SUFQUCxBQURBLEFBSEEsNkJBQWUsdUNBR29CLDZFQUNEOzs7SUFXcEMsNkJBQWtFO0lBQ2hFLDhCQUE2QjtJQUMzQiwyQkFBaUU7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