104 lines
5.2 KiB
TypeScript
104 lines
5.2 KiB
TypeScript
import * as _angular_core from '@angular/core';
|
|
import { OnInit, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
|
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
import { AnimationEvent } from '@angular/animations';
|
|
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 elementRef;
|
|
private readonly destroyRef;
|
|
private readonly templateRef;
|
|
readonly nzValue: _angular_core.InputSignal<string | number>;
|
|
readonly nzIcon: _angular_core.InputSignal<string | undefined>;
|
|
readonly nzDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
readonly hasLabel: _angular_core.Signal<boolean>;
|
|
protected readonly name: _angular_core.Signal<string | null>;
|
|
protected readonly isChecked: _angular_core.WritableSignal<boolean>;
|
|
protected readonly parentDisabled: _angular_core.Signal<boolean>;
|
|
readonly finalDisabled: _angular_core.Signal<boolean>;
|
|
ngOnInit(): void;
|
|
handleClick(): void;
|
|
handleKeydown(event: KeyboardEvent): void;
|
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzSegmentedItemComponent, never>;
|
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NzSegmentedItemComponent, "label[nz-segmented-item],label[nzSegmentedItem]", ["nzSegmentedItem"], { "nzValue": { "alias": "nzValue"; "required": true; "isSignal": true; }; "nzIcon": { "alias": "nzIcon"; "required": false; "isSignal": true; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; "isSignal": true; }; }, {}, 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[];
|
|
|
|
declare class NzSegmentedComponent implements OnChanges, ControlValueAccessor {
|
|
readonly _nzModuleName: NzConfigKey;
|
|
readonly nzConfigService: NzConfigService;
|
|
private readonly cdr;
|
|
private readonly service;
|
|
private readonly injector;
|
|
protected readonly dir: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
nzBlock: boolean;
|
|
nzDisabled: boolean;
|
|
nzOptions: NzSegmentedOptions;
|
|
nzVertical: boolean;
|
|
nzShape: 'default' | 'round';
|
|
nzSize: NzSizeLDSType;
|
|
/**
|
|
* @description set the `name` attribute of the segmented item native `input[type="radio"]`
|
|
* @since 20.3.0
|
|
*/
|
|
nzName?: string;
|
|
readonly nzValueChange: EventEmitter<string | number>;
|
|
private viewItemCmps;
|
|
private contentItemCmps;
|
|
private renderedItemCmps;
|
|
private isDisabledFirstChange;
|
|
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;
|
|
private onOffset;
|
|
private onKeyDown;
|
|
writeValue(value: number | string): void;
|
|
registerOnChange(fn: OnChangeType): void;
|
|
registerOnTouched(fn: OnTouchedType): void;
|
|
setDisabledState(disabled: boolean): void;
|
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzSegmentedComponent, never>;
|
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NzSegmentedComponent, "nz-segmented", ["nzSegmented"], { "nzBlock": { "alias": "nzBlock"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; "nzOptions": { "alias": "nzOptions"; "required": false; }; "nzVertical": { "alias": "nzVertical"; "required": false; }; "nzShape": { "alias": "nzShape"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; "nzName": { "alias": "nzName"; "required": false; }; }, { "nzValueChange": "nzValueChange"; }, ["contentItemCmps"], ["*"], true, never>;
|
|
static ngAcceptInputType_nzBlock: unknown;
|
|
static ngAcceptInputType_nzDisabled: unknown;
|
|
static ngAcceptInputType_nzVertical: unknown;
|
|
}
|
|
|
|
declare class NzSegmentedModule {
|
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzSegmentedModule, never>;
|
|
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<NzSegmentedModule, never, [typeof NzSegmentedComponent, typeof NzSegmentedItemComponent], [typeof NzSegmentedComponent, typeof NzSegmentedItemComponent]>;
|
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<NzSegmentedModule>;
|
|
}
|
|
|
|
export { NzSegmentedComponent, NzSegmentedItemComponent, NzSegmentedModule, normalizeOptions };
|
|
export type { NzSegmentedOption, NzSegmentedOptions, NzSegmentedWithIcon, NzSegmentedWithLabel };
|