UNPKG

@ng-doc/app

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

33 lines (29 loc) 3.01 kB
import * as i0 from '@angular/core'; import { ChangeDetectionStrategy, Component } from '@angular/core'; import { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes'; import { NgDocCheckboxComponent, NgDocTooltipDirective } from '@ng-doc/ui-kit'; import { DIControl, provideHostControl } from 'di-controls'; class NgDocBooleanControlComponent extends DIControl { constructor() { super(); this.name = ''; this.description = ''; } get defaultValue() { return Object.prototype.hasOwnProperty.call(this, 'default') ? this.default : false; } updateModel(obj) { super.updateModel(obj ? obj : !this.defaultValue ? this.defaultValue : false); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgDocBooleanControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: NgDocBooleanControlComponent, isStandalone: true, selector: "ng-doc-boolean-control", providers: [provideHostControl(NgDocBooleanControlComponent)], usesInheritance: true, ngImport: i0, template: "<ng-doc-checkbox [ngDocTooltip]=\"tooltipTemplate\" [canOpen]=\"!!description\">\n\t{{ name }}\n\t<ng-template #tooltipTemplate>\n\t\t<div [innerHTML]=\"description | ngDocSanitizeHtml\"></div>\n\t</ng-template>\n</ng-doc-checkbox>\n", styles: [":host{display:inline-flex;width:100%}\n"], dependencies: [{ kind: "component", type: NgDocCheckboxComponent, selector: "ng-doc-checkbox", inputs: ["color"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgDocBooleanControlComponent, decorators: [{ type: Component, args: [{ selector: 'ng-doc-boolean-control', providers: [provideHostControl(NgDocBooleanControlComponent)], changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocCheckboxComponent, NgDocTooltipDirective, NgDocSanitizeHtmlPipe], template: "<ng-doc-checkbox [ngDocTooltip]=\"tooltipTemplate\" [canOpen]=\"!!description\">\n\t{{ name }}\n\t<ng-template #tooltipTemplate>\n\t\t<div [innerHTML]=\"description | ngDocSanitizeHtml\"></div>\n\t</ng-template>\n</ng-doc-checkbox>\n", styles: [":host{display:inline-flex;width:100%}\n"] }] }], ctorParameters: () => [] }); /** * Generated bundle index. Do not edit. */ export { NgDocBooleanControlComponent }; //# sourceMappingURL=ng-doc-app-type-controls-boolean-control.mjs.map