@ng-doc/ui-kit
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>
89 lines (83 loc) • 8.98 kB
JavaScript
import { NgIf } from '@angular/common';
import * as i0 from '@angular/core';
import { Directive, Component, ChangeDetectionStrategy, Input, HostBinding, ContentChild } from '@angular/core';
/** Using to display content on the left side */
class NgDocTextLeftDirective {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextLeftDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: NgDocTextLeftDirective, isStandalone: true, selector: "[ngDocTextLeft]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextLeftDirective, decorators: [{
type: Directive,
args: [{
selector: '[ngDocTextLeft]',
standalone: true,
}]
}] });
/** Using to display content on the right side */
class NgDocTextRightDirective {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextRightDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: NgDocTextRightDirective, isStandalone: true, selector: "[ngDocTextRight]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextRightDirective, decorators: [{
type: Directive,
args: [{
selector: '[ngDocTextRight]',
standalone: true,
}]
}] });
class NgDocTextComponent {
constructor(changeDetectorRef) {
this.changeDetectorRef = changeDetectorRef;
/** Text size */
this.size = 'medium';
/** Text color */
this.color = 'normal';
/** Text align */
this.align = 'left';
this.absoluteContent = false;
this.ngDocElement = true;
}
ngAfterContentChecked() {
this.changeDetectorRef.detectChanges();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgDocTextComponent, isStandalone: true, selector: "[ng-doc-text]", inputs: { size: "size", color: "color", align: "align", absoluteContent: "absoluteContent" }, host: { properties: { "attr.data-ng-doc-text-size": "this.size", "attr.data-ng-doc-text-color": "this.color", "attr.data-ng-doc-text-align": "this.align", "attr.data-ng-doc-text-absolute": "this.absoluteContent", "class.ngde": "this.ngDocElement" } }, queries: [{ propertyName: "leftContent", first: true, predicate: NgDocTextLeftDirective, descendants: true }, { propertyName: "rightContent", first: true, predicate: NgDocTextRightDirective, descendants: true }], ngImport: i0, template: "<span class=\"ng-doc-text-left\" *ngIf=\"leftContent\">\n\t<ng-content select=\"[ngDocTextLeft]\"></ng-content>\n</span>\n<span class=\"ng-doc-text\">\n\t<ng-content></ng-content>\n</span>\n<span class=\"ng-doc-text-right\" *ngIf=\"rightContent\">\n\t<ng-content select=\"[ngDocTextRight]\"></ng-content>\n</span>\n", styles: ["::ng-deep :root{--ng-doc-text-left-width: auto;--ng-doc-text-right-width: auto}:host{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);position:relative;display:flex;align-items:center}:host[data-ng-doc-text-size=small]{--ng-doc-font-size: 14px;--ng-doc-line-height: 18px}:host[data-ng-doc-text-color=muted]{--ng-doc-text: var(--ng-doc-text-muted)}:host[data-ng-doc-text-align=center] .ng-doc-text{text-align:center}:host[data-ng-doc-text-align=right] .ng-doc-text{text-align:right}:host[data-ng-doc-text-absolute=true] .ng-doc-text-left{position:absolute;transform:translate(calc(-100% - var(--ng-doc-base-gutter)))}:host[data-ng-doc-text-absolute=true] .ng-doc-text-right{position:absolute;right:0;transform:translate(calc(100% + var(--ng-doc-base-gutter)))}:hostspan{display:inline-flex}:hostspan .ng-doc-text{width:auto}:host .ng-doc-text-left,:host .ng-doc-text-right{display:flex;justify-content:center;flex-shrink:0;min-height:var(--ng-doc-line-height);align-items:center}:host .ng-doc-text-left ::ng-deep>ng-doc-svg-icon,:host .ng-doc-text-right ::ng-deep>ng-doc-svg-icon{display:flex;min-height:var(--ng-doc-line-height)}:host .ng-doc-text{width:100%}:host .ng-doc-text:empty{display:none}:host[data-ng-doc-text-absolute=false] .ng-doc-text-left:not(:empty){width:var(--ng-doc-text-left-width)}:host[data-ng-doc-text-absolute=false] .ng-doc-text-left:not(:empty)~.ng-doc-text{margin-left:var(--ng-doc-base-gutter)}:host[data-ng-doc-text-absolute=false] .ng-doc-text-right:not(:empty){width:var(--ng-doc-text-right-width);margin-left:var(--ng-doc-base-gutter)}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocTextComponent, decorators: [{
type: Component,
args: [{ selector: '[ng-doc-text]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIf], template: "<span class=\"ng-doc-text-left\" *ngIf=\"leftContent\">\n\t<ng-content select=\"[ngDocTextLeft]\"></ng-content>\n</span>\n<span class=\"ng-doc-text\">\n\t<ng-content></ng-content>\n</span>\n<span class=\"ng-doc-text-right\" *ngIf=\"rightContent\">\n\t<ng-content select=\"[ngDocTextRight]\"></ng-content>\n</span>\n", styles: ["::ng-deep :root{--ng-doc-text-left-width: auto;--ng-doc-text-right-width: auto}:host{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);position:relative;display:flex;align-items:center}:host[data-ng-doc-text-size=small]{--ng-doc-font-size: 14px;--ng-doc-line-height: 18px}:host[data-ng-doc-text-color=muted]{--ng-doc-text: var(--ng-doc-text-muted)}:host[data-ng-doc-text-align=center] .ng-doc-text{text-align:center}:host[data-ng-doc-text-align=right] .ng-doc-text{text-align:right}:host[data-ng-doc-text-absolute=true] .ng-doc-text-left{position:absolute;transform:translate(calc(-100% - var(--ng-doc-base-gutter)))}:host[data-ng-doc-text-absolute=true] .ng-doc-text-right{position:absolute;right:0;transform:translate(calc(100% + var(--ng-doc-base-gutter)))}:hostspan{display:inline-flex}:hostspan .ng-doc-text{width:auto}:host .ng-doc-text-left,:host .ng-doc-text-right{display:flex;justify-content:center;flex-shrink:0;min-height:var(--ng-doc-line-height);align-items:center}:host .ng-doc-text-left ::ng-deep>ng-doc-svg-icon,:host .ng-doc-text-right ::ng-deep>ng-doc-svg-icon{display:flex;min-height:var(--ng-doc-line-height)}:host .ng-doc-text{width:100%}:host .ng-doc-text:empty{display:none}:host[data-ng-doc-text-absolute=false] .ng-doc-text-left:not(:empty){width:var(--ng-doc-text-left-width)}:host[data-ng-doc-text-absolute=false] .ng-doc-text-left:not(:empty)~.ng-doc-text{margin-left:var(--ng-doc-base-gutter)}:host[data-ng-doc-text-absolute=false] .ng-doc-text-right:not(:empty){width:var(--ng-doc-text-right-width);margin-left:var(--ng-doc-base-gutter)}\n"] }]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { size: [{
type: Input
}, {
type: HostBinding,
args: ['attr.data-ng-doc-text-size']
}], color: [{
type: Input
}, {
type: HostBinding,
args: ['attr.data-ng-doc-text-color']
}], align: [{
type: Input
}, {
type: HostBinding,
args: ['attr.data-ng-doc-text-align']
}], absoluteContent: [{
type: Input
}, {
type: HostBinding,
args: ['attr.data-ng-doc-text-absolute']
}], leftContent: [{
type: ContentChild,
args: [NgDocTextLeftDirective]
}], rightContent: [{
type: ContentChild,
args: [NgDocTextRightDirective]
}], ngDocElement: [{
type: HostBinding,
args: ['class.ngde']
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { NgDocTextComponent, NgDocTextLeftDirective, NgDocTextRightDirective };
//# sourceMappingURL=ng-doc-ui-kit-components-text.mjs.map