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
1 lines • 8.97 kB
Source Map (JSON)
{"version":3,"file":"primeng-floatlabel.mjs","sources":["../../src/floatlabel/style/floatlabelstyle.ts","../../src/floatlabel/floatlabel.ts","../../src/floatlabel/primeng-floatlabel.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BaseStyle } from 'primeng/base';\n\nconst theme = ({ dt }) => `\n.p-floatlabel {\n display: block;\n position: relative;\n}\n\n.p-floatlabel label {\n position: absolute;\n pointer-events: none;\n top: 50%;\n transform: translateY(-50%);\n transition-property: all;\n transition-timing-function: ease;\n line-height: 1;\n font-weight: ${dt('floatlabel.font.weight')};\n inset-inline-start: ${dt('floatlabel.position.x')};\n color: ${dt('floatlabel.color')};\n transition-duration: ${dt('floatlabel.transition.duration')};\n}\n\n.p-floatlabel:has(.p-textarea) label {\n top: ${dt('floatlabel.position.y')};\n transform: translateY(0);\n}\n\n.p-floatlabel:has(.p-inputicon:first-child) label {\n inset-inline-start: calc((${dt('form.field.padding.x')} * 2) + ${dt('icon.size')});\n}\n\n.p-floatlabel:has(.ng-invalid.ng-dirty) label {\n color: ${dt('floatlabel.invalid.color')};\n}\n\n.p-floatlabel:has(input:focus) label,\n.p-floatlabel:has(input.p-filled) label,\n.p-floatlabel:has(input:-webkit-autofill) label,\n.p-floatlabel:has(textarea:focus) label,\n.p-floatlabel:has(textarea.p-filled) label,\n.p-floatlabel:has(.p-inputwrapper-focus) label,\n.p-floatlabel:has(.p-inputwrapper-filled) label {\n top: ${dt('floatlabel.over.active.top')};\n transform: translateY(0);\n font-size: ${dt('floatlabel.active.font.size')};\n font-weight: ${dt('floatlabel.label.active.font.weight')};\n}\n\n.p-floatlabel:has(input.p-filled) label,\n.p-floatlabel:has(textarea.p-filled) label,\n.p-floatlabel:has(.p-inputwrapper-filled) label {\n color: ${dt('floatlabel.active.color')};\n}\n\n.p-floatlabel:has(input:focus) label,\n.p-floatlabel:has(input:-webkit-autofill) label,\n.p-floatlabel:has(textarea:focus) label,\n.p-floatlabel:has(.p-inputwrapper-focus) label {\n color: ${dt('floatlabel.focus.color')};\n}\n\n.p-floatlabel-in .p-inputtext,\n.p-floatlabel-in .p-textarea,\n.p-floatlabel-in .p-select-label,\n.p-floatlabel-in .p-multiselect-label-container,\n.p-floatlabel-in .p-autocomplete-input-multiple,\n.p-floatlabel-in .p-cascadeselect-label,\n.p-floatlabel-in .p-treeselect-label {\n padding-top: ${dt('floatlabel.in.input.padding.top')};\n}\n\n.p-floatlabel-in:has(input:focus) label,\n.p-floatlabel-in:has(input.p-filled) label,\n.p-floatlabel-in:has(input:-webkit-autofill) label,\n.p-floatlabel-in:has(textarea:focus) label,\n.p-floatlabel-in:has(textarea.p-filled) label,\n.p-floatlabel-in:has(.p-inputwrapper-focus) label,\n.p-floatlabel-in:has(.p-inputwrapper-filled) label {\n top: ${dt('floatlabel.in.active.top')};\n}\n\n.p-floatlabel-on:has(input:focus) label,\n.p-floatlabel-on:has(input.p-filled) label,\n.p-floatlabel-on:has(input:-webkit-autofill) label,\n.p-floatlabel-on:has(textarea:focus) label,\n.p-floatlabel-on:has(textarea.p-filled) label,\n.p-floatlabel-on:has(.p-inputwrapper-focus) label,\n.p-floatlabel-on:has(.p-inputwrapper-filled) label {\n top: 0;\n transform: translateY(-50%);\n border-radius: ${dt('floatlabel.on.border.radius')};\n background: ${dt('floatlabel.on.active.background')};\n padding: ${dt('floatlabel.on.active.padding')};\n}\n`;\n\nconst classes = {\n root: ({ instance, props }) => [\n 'p-floatlabel',\n {\n 'p-floatlabel-over': props.variant === 'over',\n 'p-floatlabel-on': props.variant === 'on',\n 'p-floatlabel-in': props.variant === 'in'\n }\n ]\n};\n\n@Injectable()\nexport class FloatLabelStyle extends BaseStyle {\n name = 'floatlabel';\n\n theme = theme;\n\n classes = classes;\n}\n\n/**\n *\n * FloatLabel visually integrates a label with its form element.\n *\n * [Live Demo](https://www.primeng.org/floatlabel/)\n *\n * @module floatlabelstyle\n *\n */\nexport enum FloatLabelClasses {\n /**\n * Class name of the root element\n */\n root = 'p-floatlabel'\n}\n\nexport interface FloatLabelStyle extends BaseStyle {}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Input, NgModule, ViewEncapsulation } from '@angular/core';\nimport { SharedModule } from 'primeng/api';\nimport { BaseComponent } from 'primeng/basecomponent';\nimport { FloatLabelStyle } from './style/floatlabelstyle';\n\n/**\n * FloatLabel appears on top of the input field when focused.\n * @group Components\n */\n@Component({\n selector: 'p-floatlabel, p-floatLabel, p-float-label',\n standalone: true,\n imports: [CommonModule, SharedModule],\n template: ` <ng-content></ng-content> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [FloatLabelStyle],\n host: {\n '[class.p-floatlabel]': 'true',\n '[class.p-floatlabel-over]': \"variant === 'over'\",\n '[class.p-floatlabel-on]': \"variant === 'on'\",\n '[class.p-floatlabel-in]': \"variant === 'in'\"\n }\n})\nexport class FloatLabel extends BaseComponent {\n _componentStyle = inject(FloatLabelStyle);\n /**\n * Defines the positioning of the label relative to the input.\n * @group Props\n */\n @Input() variant: 'in' | 'over' | 'on' = 'over';\n}\n\n@NgModule({\n imports: [FloatLabel, SharedModule],\n exports: [FloatLabel, SharedModule]\n})\nexport class FloatLabelModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAGA,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK;;;;;;;;;;;;;;mBAcP,EAAE,CAAC,wBAAwB,CAAC,CAAA;0BACrB,EAAE,CAAC,uBAAuB,CAAC,CAAA;aACxC,EAAE,CAAC,kBAAkB,CAAC,CAAA;2BACR,EAAE,CAAC,gCAAgC,CAAC,CAAA;;;;WAIpD,EAAE,CAAC,uBAAuB,CAAC,CAA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