primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
104 lines (98 loc) • 4.74 kB
JavaScript
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Injectable, inject, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { style } from '@primeuix/styles/floatlabel';
import { BaseStyle } from 'primeng/base';
const theme = /*css*/ `
${style}
/* For PrimeNG */
.p-floatlabel:has(.ng-invalid.ng-dirty) label {
color: dt('floatlabel.invalid.color');
}
`;
const classes = {
root: ({ instance }) => [
'p-floatlabel',
{
'p-floatlabel-over': instance.variant === 'over',
'p-floatlabel-on': instance.variant === 'on',
'p-floatlabel-in': instance.variant === 'in'
}
]
};
class FloatLabelStyle extends BaseStyle {
name = 'floatlabel';
theme = theme;
classes = classes;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelStyle });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelStyle, decorators: [{
type: Injectable
}] });
/**
*
* FloatLabel visually integrates a label with its form element.
*
* [Live Demo](https://www.primeng.org/floatlabel/)
*
* @module floatlabelstyle
*
*/
var FloatLabelClasses;
(function (FloatLabelClasses) {
/**
* Class name of the root element
*/
FloatLabelClasses["root"] = "p-floatlabel";
})(FloatLabelClasses || (FloatLabelClasses = {}));
/**
* FloatLabel appears on top of the input field when focused.
* @group Components
*/
class FloatLabel extends BaseComponent {
_componentStyle = inject(FloatLabelStyle);
/**
* Defines the positioning of the label relative to the input.
* @group Props
*/
variant = 'over';
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabel, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: FloatLabel, isStandalone: true, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: { variant: "variant" }, host: { properties: { "class": "cx('root')" } }, providers: [FloatLabelStyle], usesInheritance: true, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SharedModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabel, decorators: [{
type: Component,
args: [{
selector: 'p-floatlabel, p-floatLabel, p-float-label',
standalone: true,
imports: [CommonModule, SharedModule],
template: ` <ng-content></ng-content> `,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [FloatLabelStyle],
host: {
'[class]': "cx('root')"
}
}]
}], propDecorators: { variant: [{
type: Input
}] } });
class FloatLabelModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelModule, imports: [FloatLabel, SharedModule], exports: [FloatLabel, SharedModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelModule, imports: [FloatLabel, SharedModule, SharedModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: FloatLabelModule, decorators: [{
type: NgModule,
args: [{
imports: [FloatLabel, SharedModule],
exports: [FloatLabel, SharedModule]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { FloatLabel, FloatLabelClasses, FloatLabelModule, FloatLabelStyle };
//# sourceMappingURL=primeng-floatlabel.mjs.map