@alauda-fe/common
Version:
Alauda frontend team common codes.
42 lines • 4.99 kB
JavaScript
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "../../page-guard/component/component";
import * as i3 from "../../page-guard/component/helper-directives";
import * as i4 from "@alauda/ui";
import * as i5 from "../../translate/translate.pipe";
const _c0 = a0 => ({ feature: a0 });
const _c1 = () => ["/"];
function FeatureGateForbiddenComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "button", 2);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵadvance();
i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction0(4, _c1));
i0.ɵɵadvance();
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "back_to_product"), " ");
} }
export class FeatureGateForbiddenComponent {
static { this.ɵfac = function FeatureGateForbiddenComponent_Factory(t) { return new (t || FeatureGateForbiddenComponent)(); }; }
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FeatureGateForbiddenComponent, selectors: [["acl-feature-gate-forbidden"]], inputs: { featureName: "featureName" }, decls: 4, vars: 10, consts: [[3, "allowed", "title", "description"], [4, "aclPageGuardOperation"], ["aui-button", "primary", 3, "routerLink"]], template: function FeatureGateForbiddenComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "acl-page-guard", 0);
i0.ɵɵpipe(1, "translate");
i0.ɵɵpipe(2, "translate");
i0.ɵɵtemplate(3, FeatureGateForbiddenComponent_ng_container_3_Template, 4, 5, "ng-container", 1);
i0.ɵɵelementEnd();
} if (rf & 2) {
i0.ɵɵproperty("allowed", false)("title", i0.ɵɵpipeBind1(1, 3, "page_not_accessible"))("description", i0.ɵɵpipeBind2(2, 5, "feature_not_enabled", i0.ɵɵpureFunction1(8, _c0, ctx.featureName)));
} }, dependencies: [i1.RouterLink, i2.PageGuardComponent, i3.PageGuardOperationDirective, i4.ButtonComponent, i5.TranslatePipe], encapsulation: 2, changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FeatureGateForbiddenComponent, [{
type: Component,
args: [{ selector: 'acl-feature-gate-forbidden', changeDetection: ChangeDetectionStrategy.OnPush, template: "<acl-page-guard\n [allowed]=\"false\"\n [title]=\"'page_not_accessible' | translate\"\n [description]=\"'feature_not_enabled' | translate: { feature: featureName }\"\n>\n <ng-container *aclPageGuardOperation>\n <button\n aui-button=\"primary\"\n [routerLink]=\"['/']\"\n >\n {{ 'back_to_product' | translate }}\n </button>\n </ng-container>\n</acl-page-guard>\n" }]
}], null, { featureName: [{
type: Input
}] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FeatureGateForbiddenComponent, { className: "FeatureGateForbiddenComponent" }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL2ZlYXR1cmUtZ2F0ZS1mb3JiaWRkZW4vY29tcG9uZW50L2NvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tbW9uL3NyYy9mZWF0dXJlLWdhdGUtZm9yYmlkZGVuL2NvbXBvbmVudC90ZW1wbGF0ZS5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7Ozs7Ozs7O0lDS3hFLDZCQUFxQztJQUNuQyxpQ0FHQztJQUNDLFlBQ0Y7O0lBQUEsaUJBQVM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