ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
197 lines (189 loc) • 11 kB
TypeScript
import * as i0 from '@angular/core';
import { AfterViewInit, OnChanges, OnInit, OnDestroy, EventEmitter, ElementRef, NgZone, ChangeDetectorRef, Renderer2, SimpleChanges, TemplateRef, AfterContentInit, QueryList } from '@angular/core';
import { FocusMonitor } from '@angular/cdk/a11y';
import { Direction, Directionality } from '@angular/cdk/bidi';
import { ControlValueAccessor } from '@angular/forms';
import { Subject } from 'rxjs';
import { NzFormStatusService, NzFormNoStatusService } from 'ng-zorro-antd/core/form';
import { NzDestroyService } from 'ng-zorro-antd/core/services';
import { NzValidateStatus, NgClassInterface, OnChangeType, OnTouchedType, NzSizeLDSType, NzStatus } from 'ng-zorro-antd/core/types';
import * as i1 from 'ng-zorro-antd/space';
/**
* @deprecated Will be removed in v21. It is recommended to use the new version `<nz-input-number>`.
*/
declare class NzInputNumberLegacyComponent implements ControlValueAccessor, AfterViewInit, OnChanges, OnInit, OnDestroy {
private ngZone;
private elementRef;
private cdr;
private focusMonitor;
private renderer;
private directionality;
private destroy$;
displayValue?: string | number;
isFocused: boolean;
disabled$: Subject<boolean>;
disabledUp: boolean;
disabledDown: boolean;
dir: Direction;
prefixCls: string;
status: NzValidateStatus;
statusCls: NgClassInterface;
hasFeedback: boolean;
onChange: OnChangeType;
onTouched: OnTouchedType;
readonly nzBlur: EventEmitter<any>;
readonly nzFocus: EventEmitter<any>;
/** The native `<span class="ant-input-number-handler-up"></span>` element. */
upHandler: ElementRef<HTMLElement>;
/** The native `<span class="ant-input-number-handler-down"></span>` element. */
downHandler: ElementRef<HTMLElement>;
/** The native `<input class="ant-input-number-input" />` element. */
inputElement: ElementRef<HTMLInputElement>;
nzSize: NzSizeLDSType;
nzMin: number;
nzMax: number;
nzParser: (value: string) => string;
nzPrecision?: number;
nzPrecisionMode: 'cut' | 'toFixed' | ((value: number | string, precision?: number) => number);
nzPlaceHolder: string;
nzStatus: NzStatus;
nzStep: number;
nzInputMode: string;
nzId: string | null;
nzDisabled: boolean;
nzReadOnly: boolean;
nzAutoFocus: boolean;
nzBorderless: boolean;
nzFormatter: (value: number) => string | number;
protected finalSize: i0.Signal<NzSizeLDSType>;
private size;
private compactSize;
private autoStepTimer?;
private parsedValue?;
private value?;
private isNzDisableFirstChange;
onModelChange(value: string): void;
getCurrentValidValue(value: string | number): number;
isNotCompleteNumber(num: string | number): boolean;
getValidValue(value?: string | number): string | number | undefined;
toNumber(num: string | number): number;
getRatio(e: KeyboardEvent): number;
down(e: MouseEvent | KeyboardEvent, ratio?: number): void;
up(e: MouseEvent | KeyboardEvent, ratio?: number): void;
getPrecision(value: number): number;
getMaxPrecision(currentValue: string | number, ratio: number): number;
getPrecisionFactor(currentValue: string | number, ratio: number): number;
upStep(val: string | number, rat: number): number;
downStep(val: string | number, rat: number): number;
step<T extends keyof NzInputNumberLegacyComponent>(type: T, e: MouseEvent | KeyboardEvent, ratio?: number): void;
stop(): void;
setValue(value: number): void;
updateDisplayValue(value: number): void;
writeValue(value: number): void;
registerOnChange(fn: OnChangeType): void;
registerOnTouched(fn: OnTouchedType): void;
setDisabledState(disabled: boolean): void;
focus(): void;
blur(): void;
nzFormStatusService: NzFormStatusService | null;
nzFormNoStatusService: NzFormNoStatusService | null;
constructor(ngZone: NgZone, elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, focusMonitor: FocusMonitor, renderer: Renderer2, directionality: Directionality, destroy$: NzDestroyService);
ngOnInit(): void;
ngOnChanges({ nzStatus, nzDisabled, nzFormatter, nzSize }: SimpleChanges): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
private setupHandlersListeners;
private setStatusStyles;
static ɵfac: i0.ɵɵFactoryDeclaration<NzInputNumberLegacyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzInputNumberLegacyComponent, "nz-input-number", ["nzInputNumber"], { "nzSize": { "alias": "nzSize"; "required": false; }; "nzMin": { "alias": "nzMin"; "required": false; }; "nzMax": { "alias": "nzMax"; "required": false; }; "nzParser": { "alias": "nzParser"; "required": false; }; "nzPrecision": { "alias": "nzPrecision"; "required": false; }; "nzPrecisionMode": { "alias": "nzPrecisionMode"; "required": false; }; "nzPlaceHolder": { "alias": "nzPlaceHolder"; "required": false; }; "nzStatus": { "alias": "nzStatus"; "required": false; }; "nzStep": { "alias": "nzStep"; "required": false; }; "nzInputMode": { "alias": "nzInputMode"; "required": false; }; "nzId": { "alias": "nzId"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; "nzReadOnly": { "alias": "nzReadOnly"; "required": false; }; "nzAutoFocus": { "alias": "nzAutoFocus"; "required": false; }; "nzBorderless": { "alias": "nzBorderless"; "required": false; }; "nzFormatter": { "alias": "nzFormatter"; "required": false; }; }, { "nzBlur": "nzBlur"; "nzFocus": "nzFocus"; }, never, never, true, [{ directive: typeof i1.NzSpaceCompactItemDirective; inputs: {}; outputs: {}; }]>;
static ngAcceptInputType_nzMin: unknown;
static ngAcceptInputType_nzMax: unknown;
static ngAcceptInputType_nzStep: unknown;
static ngAcceptInputType_nzDisabled: unknown;
static ngAcceptInputType_nzReadOnly: unknown;
static ngAcceptInputType_nzAutoFocus: unknown;
static ngAcceptInputType_nzBorderless: unknown;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @deprecated Will be removed in v21. It is recommended to use the new version `<nz-input-number>`.
*/
declare class NzInputNumberGroupSlotComponent {
icon?: string | null;
type: 'addon' | 'prefix' | 'suffix' | null;
template?: string | TemplateRef<void> | null;
static ɵfac: i0.ɵɵFactoryDeclaration<NzInputNumberGroupSlotComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzInputNumberGroupSlotComponent, "[nz-input-number-group-slot]", never, { "icon": { "alias": "icon"; "required": false; }; "type": { "alias": "type"; "required": false; }; "template": { "alias": "template"; "required": false; }; }, {}, never, ["*"], true, never>;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @deprecated Will be removed in v21. It is recommended to use the new version `<nz-input-number>`.
*/
declare class NzInputNumberGroupWhitSuffixOrPrefixDirective {
elementRef: ElementRef;
constructor(elementRef: ElementRef);
static ɵfac: i0.ɵɵFactoryDeclaration<NzInputNumberGroupWhitSuffixOrPrefixDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzInputNumberGroupWhitSuffixOrPrefixDirective, "nz-input-number-group[nzSuffix], nz-input-number-group[nzPrefix]", never, {}, {}, never, never, true, never>;
}
/**
* @deprecated Will be removed in v21. It is recommended to use the new version `<nz-input-number>`.
*/
declare class NzInputNumberGroupComponent implements AfterContentInit, OnChanges, OnInit, OnDestroy {
private focusMonitor;
private elementRef;
private renderer;
private cdr;
private directionality;
listOfNzInputNumberComponent: QueryList<NzInputNumberLegacyComponent>;
nzAddOnBeforeIcon?: string | null;
nzAddOnAfterIcon?: string | null;
nzPrefixIcon?: string | null;
nzSuffixIcon?: string | null;
nzAddOnBefore?: string | TemplateRef<void>;
nzAddOnAfter?: string | TemplateRef<void>;
nzPrefix?: string | TemplateRef<void>;
nzStatus: NzStatus;
nzSuffix?: string | TemplateRef<void>;
nzSize: NzSizeLDSType;
isLarge: boolean;
isSmall: boolean;
isAffix: boolean;
isAddOn: boolean;
isFeedback: boolean;
focused: boolean;
disabled: boolean;
dir: Direction;
prefixCls: string;
affixStatusCls: NgClassInterface;
groupStatusCls: NgClassInterface;
affixInGroupStatusCls: NgClassInterface;
status: NzValidateStatus;
hasFeedback: boolean;
private destroy$;
private nzFormStatusService;
private nzFormNoStatusService;
constructor(focusMonitor: FocusMonitor, elementRef: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef, directionality: Directionality);
updateChildrenInputSize(): void;
ngOnInit(): void;
ngAfterContentInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
private setStatusStyles;
static ɵfac: i0.ɵɵFactoryDeclaration<NzInputNumberGroupComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzInputNumberGroupComponent, "nz-input-number-group", ["nzInputNumberGroup"], { "nzAddOnBeforeIcon": { "alias": "nzAddOnBeforeIcon"; "required": false; }; "nzAddOnAfterIcon": { "alias": "nzAddOnAfterIcon"; "required": false; }; "nzPrefixIcon": { "alias": "nzPrefixIcon"; "required": false; }; "nzSuffixIcon": { "alias": "nzSuffixIcon"; "required": false; }; "nzAddOnBefore": { "alias": "nzAddOnBefore"; "required": false; }; "nzAddOnAfter": { "alias": "nzAddOnAfter"; "required": false; }; "nzPrefix": { "alias": "nzPrefix"; "required": false; }; "nzStatus": { "alias": "nzStatus"; "required": false; }; "nzSuffix": { "alias": "nzSuffix"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; }, {}, ["listOfNzInputNumberComponent"], ["*"], true, [{ directive: typeof i1.NzSpaceCompactItemDirective; inputs: {}; outputs: {}; }]>;
}
/**
* @deprecated Will be removed in v21. It is recommended to use the new version `<nz-input-number>`.
*/
declare class NzInputNumberLegacyModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NzInputNumberLegacyModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzInputNumberLegacyModule, never, [typeof NzInputNumberLegacyComponent, typeof NzInputNumberGroupComponent, typeof NzInputNumberGroupWhitSuffixOrPrefixDirective, typeof NzInputNumberGroupSlotComponent], [typeof NzInputNumberLegacyComponent, typeof NzInputNumberGroupComponent, typeof NzInputNumberGroupWhitSuffixOrPrefixDirective]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzInputNumberLegacyModule>;
}
export { NzInputNumberGroupComponent, NzInputNumberGroupSlotComponent, NzInputNumberGroupWhitSuffixOrPrefixDirective, NzInputNumberLegacyComponent, NzInputNumberLegacyModule };