@alauda-fe/common
Version:
Alauda frontend team common codes.
110 lines (109 loc) • 13.1 kB
JavaScript
import { ChangeDetectionStrategy, Component, Input, TemplateRef, } from '@angular/core';
import * as i0 from "@angular/core";
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);
} }, 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tbGVnZW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL2NoYXJ0L2N1c3RvbS10ZW1wbGF0ZS9kcm9wZG93bi1sZWdlbmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsS0FBSyxFQUNMLFdBQVcsR0FDWixNQUFNLGVBQWUsQ0FBQzs7Ozs7SUFPbkIsNkJBQWlEO0lBQy9DLDhCQVNZOzs7OztJQU5WLGNBQW1DO0lBQ25DLEFBREEsb0RBQW1DLDZFQUNEOzs7SUFRcEMsaUNBV0M7SUFDQy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