ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
94 lines (87 loc) • 4.41 kB
TypeScript
import * as i0 from '@angular/core';
import { OnInit, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
import { AnimationEvent } from '@angular/animations';
import { Direction } from '@angular/cdk/bidi';
import { ControlValueAccessor } from '@angular/forms';
import { ThumbAnimationProps } from 'ng-zorro-antd/core/animation';
import { NzConfigKey, NzConfigService } from 'ng-zorro-antd/core/config';
import { NzSizeLDSType, OnChangeType, OnTouchedType } from 'ng-zorro-antd/core/types';
declare class NzSegmentedItemComponent implements OnInit {
private readonly service;
private readonly cdr;
private readonly elementRef;
private readonly destroyRef;
nzIcon?: string;
nzValue: string | number;
nzDisabled?: boolean;
protected isChecked: boolean;
readonly parentDisabled: i0.Signal<boolean>;
ngOnInit(): void;
handleClick(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzSegmentedItemComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzSegmentedItemComponent, "label[nz-segmented-item],label[nzSegmentedItem]", ["nzSegmentedItem"], { "nzIcon": { "alias": "nzIcon"; "required": false; }; "nzValue": { "alias": "nzValue"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "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
*/
type NzSegmentedOption = {
value: string | number;
disabled?: boolean;
} & (NzSegmentedWithLabel | NzSegmentedWithIcon);
interface NzSegmentedWithLabel {
label: string;
icon?: string;
}
interface NzSegmentedWithIcon {
icon: string;
label?: string;
}
type NzSegmentedOptions = Array<NzSegmentedOption | string | number>;
declare function normalizeOptions(unnormalized: NzSegmentedOptions): NzSegmentedOption[];
/**
* 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
*/
declare class NzSegmentedComponent implements OnChanges, ControlValueAccessor {
readonly _nzModuleName: NzConfigKey;
readonly nzConfigService: NzConfigService;
private readonly cdr;
private readonly directionality;
private readonly service;
nzBlock: boolean;
nzDisabled: boolean;
nzOptions: NzSegmentedOptions;
nzSize: NzSizeLDSType;
readonly nzValueChange: EventEmitter<string | number>;
private viewItemCmps;
private contentItemCmps;
private isDisabledFirstChange;
protected dir: Direction;
protected value?: number | string;
protected animationState: null | {
value: string;
params: ThumbAnimationProps;
};
protected normalizedOptions: NzSegmentedOption[];
protected onChange: OnChangeType;
protected onTouched: OnTouchedType;
constructor();
ngOnChanges(changes: SimpleChanges): void;
handleThumbAnimationDone(event: AnimationEvent): void;
writeValue(value: number | string): void;
registerOnChange(fn: OnChangeType): void;
registerOnTouched(fn: OnTouchedType): void;
setDisabledState(disabled: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzSegmentedComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzSegmentedComponent, "nz-segmented", ["nzSegmented"], { "nzBlock": { "alias": "nzBlock"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; "nzOptions": { "alias": "nzOptions"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; }, { "nzValueChange": "nzValueChange"; }, ["contentItemCmps"], ["*"], true, never>;
static ngAcceptInputType_nzBlock: unknown;
static ngAcceptInputType_nzDisabled: unknown;
}
declare class NzSegmentedModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NzSegmentedModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzSegmentedModule, never, [typeof NzSegmentedComponent, typeof NzSegmentedItemComponent], [typeof NzSegmentedComponent, typeof NzSegmentedItemComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzSegmentedModule>;
}
export { NzSegmentedComponent, NzSegmentedItemComponent, NzSegmentedModule, normalizeOptions };
export type { NzSegmentedOption, NzSegmentedOptions, NzSegmentedWithIcon, NzSegmentedWithLabel };