carbon-components-angular
Version:
Next generation components
154 lines (150 loc) • 5.29 kB
TypeScript
/**
*
* carbon-angular v0.0.0 | text-input-label.component.d.ts
*
* Copyright 2014, 2026 IBM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from "@angular/core";
import * as i0 from "@angular/core";
/**
* Get started with importing the module:
*
* ```typescript
* import { InputModule } from 'carbon-components-angular';
* ```
*
* ```html
* <cds-text-label>
* Label
* <input cdsText type="text" class="input-field">
* </cds-text-label>
* ```
*
* [See demo](../../?path=/story/components-input--basic)
*/
export declare class TextInputLabelComponent implements AfterViewInit, AfterContentInit, OnChanges, OnDestroy {
protected changeDetectorRef: ChangeDetectorRef;
get isInlineWrapper(): boolean;
get isReadonly(): boolean;
get fluidClass(): boolean;
get fluidSkeletonClass(): boolean;
/**
* Used to build the id of the input item associated with the `Label`.
*/
static labelCounter: number;
/**
* The id of the input item associated with the `Label`. This value is also used to associate the `Label` with
* its input counterpart through the 'for' attribute.
*/
labelInputID: string;
/**
* Set to `true` for a disabled label.
*/
disabled: boolean;
/**
* Set to `true` for a loading label.
*/
skeleton: boolean;
/**
* Helper input property for ease of migration
* Since we cannot pass ng-content down easily from label component, we will accept the templates
*/
labelTemplate: TemplateRef<any>;
textInputTemplate: TemplateRef<any>;
/**
* Optional helper text that appears under the label.
*/
helperText: string | TemplateRef<any>;
/**
* Sets the invalid text.
*/
invalidText: string | TemplateRef<any>;
/**
* Set to `true` for an invalid label component.
*/
invalid: boolean;
/**
* Set to `true` to show a warning (contents set by warningText)
*/
warn: boolean;
/**
* Sets the warning text
*/
warnText: string | TemplateRef<any>;
/**
* Set the arialabel for label
*/
ariaLabel: string;
/**
* Experimental: enable fluid state
*/
fluid: boolean;
/**
* Set to `true` to hide the label visually, but keep accessible to
* screen readers.
*/
hideLabel: boolean;
/**
* Set to `true` to render the label and field side-by-side instead of stacked.
*/
inline: boolean;
/**
* The render size for the `TextInput`. Used to compute the INLINE label size
* variant class (`cds--label--inline--{size}`).
*/
size: "sm" | "md" | "lg";
/**
* Set to `true` (`maxCount` must be set) to displays a live character
* counter alongside the label.
*/
enableCounter: boolean;
/**
* Maximum number of characters (or words) allowed. Required for the
* counter to display.
*/
maxCount: number;
textCount: number;
wrapper: ElementRef<HTMLDivElement>;
labelClass: boolean;
textInputWrapper: boolean;
private _inputElement;
private _inputListener;
/**
* Creates an instance of Label.
*/
constructor(changeDetectorRef: ChangeDetectorRef);
/**
* Sets the id on the input item associated with the `Label` and attaches the
* counter listener when `enableCounter` is already `true` on first render.
*/
ngAfterViewInit(): void;
/**
* Attach/remove listener and seed `textCount` from the textarea's current value.
* @param changes
*/
ngOnChanges(changes: SimpleChanges): void;
ngAfterContentInit(): void;
ngOnDestroy(): void;
isTemplate(value: any): boolean;
/**
* Attaches the input event listener, ensuring it is never added twice.
*/
private _attachCounterListener;
/**
* Removes the input event listener and clears the cached reference.
*/
private _detachCounterListener;
static ɵfac: i0.ɵɵFactoryDeclaration<TextInputLabelComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TextInputLabelComponent, "cds-text-label, ibm-text-label", never, { "labelInputID": "labelInputID"; "disabled": "disabled"; "skeleton": "skeleton"; "labelTemplate": "labelTemplate"; "textInputTemplate": "textInputTemplate"; "helperText": "helperText"; "invalidText": "invalidText"; "invalid": "invalid"; "warn": "warn"; "warnText": "warnText"; "ariaLabel": "ariaLabel"; "fluid": "fluid"; "hideLabel": "hideLabel"; "inline": "inline"; "size": "size"; "enableCounter": "enableCounter"; "maxCount": "maxCount"; }, {}, never, ["*", "[cdsText],[ibmText],input[type=text],div"], false>;
}