/** * * carbon-angular v0.0.0 | number.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 { EventEmitter, TemplateRef } from "@angular/core"; import { ControlValueAccessor } from "@angular/forms"; import { I18n, Overridable } from "carbon-components-angular/i18n"; import { Observable } from "rxjs"; import * as i0 from "@angular/core"; /** * Used to emit changes performed on number input components. */ export declare class NumberChange { /** * Contains the `Number` that has been changed. */ source: NumberComponent; /** * The value of the `Number` field encompassed in the `NumberChange` class. */ value: number; } /** * Get started with importing the module: * * ```typescript * import { NumberModule } from 'carbon-components-angular'; * ``` * * [See demo](../../?path=/story/components-number--basic) */ export declare class NumberComponent implements ControlValueAccessor { protected i18n: I18n; /** * Variable used for creating unique ids for number input components. */ static numberCount: number; containerClass: boolean; /** * Set to `true` for readonly state. */ readonly: boolean; /** * @deprecated since v5 - Use `cdsLayer` directive instead * `light` or `dark` number input theme. */ theme: "light" | "dark"; /** * Set to `true` for a disabled number input. */ disabled: boolean; /** * Set to `true` for a loading number component. */ skeleton: boolean; /** * Set to `true` for an invalid number component. */ invalid: boolean; /** * The unique id for the number component. */ id: string; /** * Sets the placeholder attribute on the `input` element. */ placeholder: string; /** * Number input field render size */ size: "sm" | "md" | "lg"; /** * Reflects the required attribute of the `input` element. */ required: boolean; /** * Sets the value attribute on the `input` element. */ set value(v: any); get value(): any; /** * Sets the min attribute on the `input` element. */ min: any; /** * Sets the max attribute on the `input` element. */ max: any; /** * Sets the text inside the `label` tag. */ label: string | TemplateRef; /** * Sets the optional helper text. */ helperText: string | TemplateRef; /** * Sets the invalid text. */ invalidText: string | TemplateRef; /** * Sets the amount the number controls increment and decrement by. */ step: number; /** * If `step` is a decimal, we may want precision to be set to go around floating point precision. */ precision: number; /** * Set to `true` to show a warning (contents set by warningText) */ warn: boolean; /** * Sets the warning text */ warnText: string | TemplateRef; /** * Sets the arialabel for input */ ariaLabel: string; /** * Emits event notifying other classes when a change in state occurs in the input. */ change: EventEmitter; set decrementLabel(value: string | Observable); get decrementLabel(): string | Observable; set incrementLabel(value: string | Observable); get incrementLabel(): string | Observable; /** * Experimental: enable fluid state */ fluid: boolean; get fluidInvalid(): boolean; get fluidDisabled(): boolean; get fluidFocus(): boolean; get fluidSkeleton(): boolean; protected _isFocused: boolean; protected _value: number; protected _decrementLabel: Overridable; protected _incrementLabel: Overridable; /** * Creates an instance of `Number`. */ constructor(i18n: I18n); /** * This is the initial value set to the component * @param value The input value. */ writeValue(value: any): void; /** * Sets a method in order to propagate changes back to the form. */ registerOnChange(fn: any): void; /** * Registers a callback to be triggered when the control has been touched. * @param fn Callback to be triggered when the number input is touched. */ registerOnTouched(fn: any): void; focusOut(): void; /** * Sets the disabled state through the model */ setDisabledState(isDisabled: boolean): void; /** * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`. */ onTouched: () => any; /** * Method set in `registerOnChange` to propagate changes back to the form. */ propagateChange: (_: any) => void; /** * Adds `step` to the current `value`. */ onIncrement(): void; /** * Subtracts `step` to the current `value`. */ onDecrement(): void; getDecrementLabel(): Observable; getIncrementLabel(): Observable; /** * Creates a class of `NumberChange` to emit the change in the `Number`. */ emitChangeEvent(): void; onNumberInputChange(event: any): void; isTemplate(value: any): boolean; handleFocus(event: FocusEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { NumberComponent as Number };