primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
86 lines (81 loc) • 3.86 kB
JavaScript
import * as i0 from '@angular/core';
import { Injectable, InjectionToken, inject, Directive, NgModule } from '@angular/core';
import { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';
import * as i1 from 'primeng/bind';
import { Bind } from 'primeng/bind';
import { style } from '@primeuix/styles/label';
import { BaseStyle } from 'primeng/base';
const classes = {
root: 'p-label p-component'
};
class LabelStyle extends BaseStyle {
name = 'label';
style = style;
classes = classes;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelStyle, decorators: [{
type: Injectable
}] });
/**
*
* Label is used to create labels for form elements.
*
* [Live Demo](https://www.primeng.org/label/)
*
* @module labelstyle
*
*/
var LabelClasses;
(function (LabelClasses) {
/**
* Class name of the root element
*/
LabelClasses["root"] = "p-label";
})(LabelClasses || (LabelClasses = {}));
const LABEL_INSTANCE = new InjectionToken('LABEL_INSTANCE');
/**
* Label directive is an extension to standard label element with theming.
* @group Components
*/
class Label extends BaseComponent {
componentName = 'Label';
_componentStyle = inject(LabelStyle);
$pcLabel = inject(LABEL_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
bindDirectiveInstance = inject(Bind, { self: true });
onAfterViewChecked() {
this.bindDirectiveInstance.setAttrs(this.ptm('root'));
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Label, deps: null, target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: Label, isStandalone: true, selector: "label[pLabel]", host: { properties: { "class": "cx('root')" } }, providers: [LabelStyle, { provide: LABEL_INSTANCE, useExisting: Label }, { provide: PARENT_INSTANCE, useExisting: Label }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Label, decorators: [{
type: Directive,
args: [{
selector: 'label[pLabel]',
standalone: true,
host: {
'[class]': "cx('root')"
},
providers: [LabelStyle, { provide: LABEL_INSTANCE, useExisting: Label }, { provide: PARENT_INSTANCE, useExisting: Label }],
hostDirectives: [Bind]
}]
}] });
class LabelModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: LabelModule, imports: [Label], exports: [Label] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelModule });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelModule, decorators: [{
type: NgModule,
args: [{
imports: [Label],
exports: [Label]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { Label, LabelClasses, LabelModule, LabelStyle };
//# sourceMappingURL=primeng-label.mjs.map