UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

114 lines (113 loc) 13.5 kB
import { ChangeDetectionStrategy, Component, Input, TemplateRef, } 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 "@alauda/ui"; import * as i4 from "../../translate/translate.pipe"; const _c0 = () => []; const _c1 = a0 => ({ data: a0 }); function DropdownLegendComponent_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 DropdownLegendComponent_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 DropdownLegendComponent_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 DropdownLegendComponent_ng_template_3_ng_template_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtext(0); i0.ɵɵpipe(1, "translate"); } if (rf & 2) { i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(1, 1, "no_data"), " "); } } function DropdownLegendComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, DropdownLegendComponent_ng_template_3_ng_container_0_Template, 3, 1, "ng-container", 3)(1, DropdownLegendComponent_ng_template_3_ng_template_1_Template, 2, 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 DropdownLegendComponent { static { this.ɵfac = function DropdownLegendComponent_Factory(t) { return new (t || DropdownLegendComponent)(); }; } static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DropdownLegendComponent, selectors: [["acl-dropdown-legend"]], 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"]], template: function DropdownLegendComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵtemplate(0, DropdownLegendComponent_ng_container_0_Template, 2, 5, "ng-container", 3)(1, DropdownLegendComponent_ng_template_1_Template, 2, 6, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(3, DropdownLegendComponent_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); } }, dependencies: [i1.NgIf, i1.NgTemplateOutlet, i2.E2eAttributeBindingDirective, i3.ButtonComponent, i3.IconComponent, i3.TooltipDirective, i3.TooltipActiveDirective, i4.TranslatePipe], styles: [".btn[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-4));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{color:rgb(var(--aui-color-secondary-text))} .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))}", ".legend-wrap[_ngcontent-%COMP%]{display:inline-block}.legend-wrap[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .legend-wrap[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:0;margin:0;list-style:none}.legend-wrap[_ngcontent-%COMP%] .legend-labels[_ngcontent-%COMP%]{display:flex}.legend-wrap[_ngcontent-%COMP%] .legend-label[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;justify-content:center}.legend-wrap[_ngcontent-%COMP%] .legend-label[_ngcontent-%COMP%]:not(:last-child){margin-right:20px}.legend-wrap[_ngcontent-%COMP%] .forbid[_ngcontent-%COMP%]{cursor:no-drop}.legend-wrap[_ngcontent-%COMP%] .label-name[_ngcontent-%COMP%]{font-size:12px;color:rgb(var(--aui-color-secondary-text))}.legend-wrap[_ngcontent-%COMP%] .label-symbol[_ngcontent-%COMP%]{margin-right:4px}.disable[_ngcontent-%COMP%] .label-symbol[_ngcontent-%COMP%]{background:rgb(var(--aui-color-n-6))!important}.disable[_ngcontent-%COMP%] .label-name[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-6))}.hover[_ngcontent-%COMP%] .label-name[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-1))}.symbol-square[_ngcontent-%COMP%]{width:12px;height:12px;display:inline-block}.symbol-line[_ngcontent-%COMP%]{width:12px;height:2px;display:inline-block}.symbol-circle[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%;display:inline-block}.operation[_ngcontent-%COMP%]{display:flex;justify-content:center}.select-all[_ngcontent-%COMP%] .aui-checkbox{font-size:12px;line-height:16px;margin-bottom:8px}"], changeDetection: 0 }); } } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DropdownLegendComponent, [{ type: Component, args: [{ selector: 'acl-dropdown-legend', 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> {{ 'no_data' | translate }} </ng-template> </ng-template> `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".btn{color:rgb(var(--aui-color-n-4));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{color:rgb(var(--aui-color-secondary-text))}::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))}\n", ".legend-wrap{display:inline-block}.legend-wrap ul,.legend-wrap li{padding:0;margin:0;list-style:none}.legend-wrap .legend-labels{display:flex}.legend-wrap .legend-label{display:flex;align-items:center;cursor:pointer;justify-content:center}.legend-wrap .legend-label:not(:last-child){margin-right:20px}.legend-wrap .forbid{cursor:no-drop}.legend-wrap .label-name{font-size:12px;color:rgb(var(--aui-color-secondary-text))}.legend-wrap .label-symbol{margin-right:4px}.disable .label-symbol{background:rgb(var(--aui-color-n-6))!important}.disable .label-name{color:rgb(var(--aui-color-n-6))}.hover .label-name{color:rgb(var(--aui-color-n-1))}.symbol-square{width:12px;height:12px;display:inline-block}.symbol-line{width:12px;height:2px;display:inline-block}.symbol-circle{width:12px;height:12px;border-radius:50%;display:inline-block}.operation{display:flex;justify-content:center}.select-all ::ng-deep .aui-checkbox{font-size:12px;line-height:16px;margin-bottom:8px}\n"] }] }], null, { data: [{ type: Input }], legendTemplate: [{ type: Input }], noData: [{ type: Input }], isCard: [{ type: Input }] }); })(); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DropdownLegendComponent, { className: "DropdownLegendComponent" }); })(); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tbGVnZW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL2NoYXJ0L2N1c3RvbS10ZW1wbGF0ZS9kcm9wZG93bi1sZWdlbmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsS0FBSyxFQUNMLFdBQVcsR0FDWixNQUFNLGVBQWUsQ0FBQzs7Ozs7Ozs7O0l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