220 lines
10 KiB
TypeScript
220 lines
10 KiB
TypeScript
import { NzSafeAny, NgClassInterface, NgStyleInterface, NzStatus } from 'ng-zorro-antd/core/types';
|
|
import * as i0 from '@angular/core';
|
|
import { AfterViewInit, TemplateRef, EventEmitter, QueryList, ElementRef, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
import { NzCheckboxComponent } from 'ng-zorro-antd/checkbox';
|
|
import { Direction } from '@angular/cdk/bidi';
|
|
import { Observable } from 'rxjs';
|
|
import { NzTransferI18nInterface } from 'ng-zorro-antd/i18n';
|
|
|
|
/**
|
|
* 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 TransferDirection = 'left' | 'right';
|
|
interface TransferItem {
|
|
title: string;
|
|
direction?: TransferDirection;
|
|
disabled?: boolean;
|
|
checked?: boolean;
|
|
hide?: boolean;
|
|
[key: string]: NzSafeAny;
|
|
}
|
|
interface TransferCanMove {
|
|
direction: TransferDirection;
|
|
list: TransferItem[];
|
|
}
|
|
interface TransferChange {
|
|
from: TransferDirection;
|
|
to: TransferDirection;
|
|
list: TransferItem[];
|
|
}
|
|
interface TransferSearchChange {
|
|
direction: TransferDirection;
|
|
value: string;
|
|
}
|
|
interface TransferSelectChange {
|
|
direction: TransferDirection;
|
|
checked: boolean;
|
|
list: TransferItem[];
|
|
item?: TransferItem;
|
|
}
|
|
interface TransferStat {
|
|
checkAll: boolean;
|
|
checkHalf: boolean;
|
|
checkCount: number;
|
|
shownCount: number;
|
|
availableCount: number;
|
|
}
|
|
interface RenderListContext {
|
|
$implicit: TransferItem[];
|
|
direction: TransferDirection;
|
|
disabled: boolean;
|
|
onItemSelectAll: (x: boolean) => void;
|
|
onItemSelect: (x: TransferItem) => void;
|
|
stat: TransferStat;
|
|
}
|
|
|
|
declare class NzTransferListComponent implements AfterViewInit {
|
|
private cdr;
|
|
direction: TransferDirection;
|
|
titleText: string;
|
|
showSelectAll: boolean;
|
|
dataSource: TransferItem[];
|
|
itemUnit: string | undefined;
|
|
itemsUnit: string | undefined;
|
|
filter: string;
|
|
oneWay: boolean;
|
|
disabled: boolean;
|
|
showSearch?: boolean;
|
|
searchPlaceholder?: string;
|
|
notFoundContent?: string;
|
|
filterOption?: (inputValue: string, item: TransferItem) => boolean;
|
|
renderList: TemplateRef<RenderListContext> | null;
|
|
render: TemplateRef<{
|
|
$implicit: TransferItem;
|
|
}> | null;
|
|
footer: TemplateRef<{
|
|
$implicit: TransferDirection;
|
|
}> | null;
|
|
readonly handleSelectAll: EventEmitter<boolean>;
|
|
readonly handleSelect: EventEmitter<TransferItem>;
|
|
readonly filterChange: EventEmitter<{
|
|
direction: TransferDirection;
|
|
value: string;
|
|
}>;
|
|
readonly moveToLeft: EventEmitter<void>;
|
|
headerCheckbox?: NzCheckboxComponent;
|
|
checkboxes: QueryList<ElementRef<HTMLLabelElement>>;
|
|
stat: TransferStat;
|
|
get validData(): TransferItem[];
|
|
get availableData(): TransferItem[];
|
|
onItemSelect: (item: TransferItem) => void;
|
|
onItemSelectAll: (status: boolean) => void;
|
|
private updateCheckStatus;
|
|
handleFilter(value: string): void;
|
|
handleClear(): void;
|
|
deleteItem(item: TransferItem): void;
|
|
private matchFilter;
|
|
markForCheck(): void;
|
|
ngAfterViewInit(): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzTransferListComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzTransferListComponent, "nz-transfer-list", ["nzTransferList"], { "direction": { "alias": "direction"; "required": false; }; "titleText": { "alias": "titleText"; "required": false; }; "showSelectAll": { "alias": "showSelectAll"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "itemUnit": { "alias": "itemUnit"; "required": false; }; "itemsUnit": { "alias": "itemsUnit"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "oneWay": { "alias": "oneWay"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "showSearch": { "alias": "showSearch"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "notFoundContent": { "alias": "notFoundContent"; "required": false; }; "filterOption": { "alias": "filterOption"; "required": false; }; "renderList": { "alias": "renderList"; "required": false; }; "render": { "alias": "render"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; }, { "handleSelectAll": "handleSelectAll"; "handleSelect": "handleSelect"; "filterChange": "filterChange"; "moveToLeft": "moveToLeft"; }, never, never, true, never>;
|
|
static ngAcceptInputType_disabled: unknown;
|
|
static ngAcceptInputType_showSearch: 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
|
|
*/
|
|
|
|
declare class NzTransferSearchComponent implements OnChanges {
|
|
private cdr;
|
|
placeholder?: string;
|
|
value?: string;
|
|
disabled: boolean;
|
|
readonly valueChanged: EventEmitter<string>;
|
|
readonly valueClear: EventEmitter<void>;
|
|
protected _handle(): void;
|
|
protected _clear(): void;
|
|
ngOnChanges(): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzTransferSearchComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzTransferSearchComponent, "[nz-transfer-search]", ["nzTransferSearch"], { "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChanged": "valueChanged"; "valueClear": "valueClear"; }, never, never, true, never>;
|
|
static ngAcceptInputType_disabled: 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
|
|
*/
|
|
|
|
declare class NzTransferComponent implements OnInit, OnChanges {
|
|
private destroyRef;
|
|
private cdr;
|
|
private i18n;
|
|
private elementRef;
|
|
private renderer;
|
|
private directionality;
|
|
private nzFormStatusService;
|
|
private nzFormNoStatusService;
|
|
lists: QueryList<NzTransferListComponent>;
|
|
locale: NzTransferI18nInterface;
|
|
leftFilter: string;
|
|
rightFilter: string;
|
|
dir: Direction;
|
|
prefixCls: string;
|
|
statusCls: NgClassInterface;
|
|
hasFeedback: boolean;
|
|
nzDisabled: boolean;
|
|
nzDataSource: TransferItem[];
|
|
nzTitles: string[];
|
|
nzOperations: string[];
|
|
nzListStyle: NgStyleInterface;
|
|
nzShowSelectAll: boolean;
|
|
nzItemUnit?: string;
|
|
nzItemsUnit?: string;
|
|
nzCanMove: (arg: TransferCanMove) => Observable<TransferItem[]>;
|
|
nzRenderList: Array<TemplateRef<NzSafeAny> | null> | null;
|
|
nzRender: TemplateRef<NzSafeAny> | null;
|
|
nzFooter: TemplateRef<NzSafeAny> | null;
|
|
nzShowSearch: boolean;
|
|
nzFilterOption?: (inputValue: string, item: TransferItem) => boolean;
|
|
nzSearchPlaceholder?: string;
|
|
nzNotFoundContent?: string;
|
|
nzTargetKeys: string[];
|
|
nzSelectedKeys: string[];
|
|
nzStatus: NzStatus;
|
|
nzOneWay: boolean;
|
|
readonly nzChange: EventEmitter<TransferChange>;
|
|
readonly nzSearchChange: EventEmitter<TransferSearchChange>;
|
|
readonly nzSelectChange: EventEmitter<TransferSelectChange>;
|
|
leftDataSource: TransferItem[];
|
|
lastLeftCheckedIndex?: number;
|
|
rightDataSource: TransferItem[];
|
|
lastRightCheckedIndex?: number;
|
|
isShiftPressed: boolean;
|
|
onTriggerShiftDown(): void;
|
|
onTriggerShiftUp(): void;
|
|
onTriggerMouseDown(event: MouseEvent): void;
|
|
private splitDataSource;
|
|
private getCheckedData;
|
|
handleLeftSelectAll: (checked: boolean) => void;
|
|
handleRightSelectAll: (checked: boolean) => void;
|
|
handleLeftSelect: (item: TransferItem) => void;
|
|
handleRightSelect: (item: TransferItem) => void;
|
|
handleSelect(direction: TransferDirection, checked: boolean, item?: TransferItem): void;
|
|
handleFilterChange(ret: {
|
|
direction: TransferDirection;
|
|
value: string;
|
|
}): void;
|
|
leftActive: boolean;
|
|
rightActive: boolean;
|
|
private updateOperationStatus;
|
|
moveToLeft: () => void;
|
|
moveToRight: () => void;
|
|
moveTo(direction: TransferDirection): void;
|
|
private truthMoveTo;
|
|
private markForCheckAllList;
|
|
private handleNzTargetKeys;
|
|
private handleNzSelectedKeys;
|
|
ngOnInit(): void;
|
|
ngOnChanges(changes: SimpleChanges): void;
|
|
private setStatusStyles;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzTransferComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzTransferComponent, "nz-transfer", ["nzTransfer"], { "nzDisabled": { "alias": "nzDisabled"; "required": false; }; "nzDataSource": { "alias": "nzDataSource"; "required": false; }; "nzTitles": { "alias": "nzTitles"; "required": false; }; "nzOperations": { "alias": "nzOperations"; "required": false; }; "nzListStyle": { "alias": "nzListStyle"; "required": false; }; "nzShowSelectAll": { "alias": "nzShowSelectAll"; "required": false; }; "nzItemUnit": { "alias": "nzItemUnit"; "required": false; }; "nzItemsUnit": { "alias": "nzItemsUnit"; "required": false; }; "nzCanMove": { "alias": "nzCanMove"; "required": false; }; "nzRenderList": { "alias": "nzRenderList"; "required": false; }; "nzRender": { "alias": "nzRender"; "required": false; }; "nzFooter": { "alias": "nzFooter"; "required": false; }; "nzShowSearch": { "alias": "nzShowSearch"; "required": false; }; "nzFilterOption": { "alias": "nzFilterOption"; "required": false; }; "nzSearchPlaceholder": { "alias": "nzSearchPlaceholder"; "required": false; }; "nzNotFoundContent": { "alias": "nzNotFoundContent"; "required": false; }; "nzTargetKeys": { "alias": "nzTargetKeys"; "required": false; }; "nzSelectedKeys": { "alias": "nzSelectedKeys"; "required": false; }; "nzStatus": { "alias": "nzStatus"; "required": false; }; "nzOneWay": { "alias": "nzOneWay"; "required": false; }; }, { "nzChange": "nzChange"; "nzSearchChange": "nzSearchChange"; "nzSelectChange": "nzSelectChange"; }, never, never, true, never>;
|
|
static ngAcceptInputType_nzDisabled: unknown;
|
|
static ngAcceptInputType_nzShowSelectAll: unknown;
|
|
static ngAcceptInputType_nzShowSearch: unknown;
|
|
static ngAcceptInputType_nzOneWay: unknown;
|
|
}
|
|
|
|
declare class NzTransferModule {
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzTransferModule, never>;
|
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NzTransferModule, never, [typeof NzTransferComponent, typeof NzTransferListComponent, typeof NzTransferSearchComponent], [typeof NzTransferComponent]>;
|
|
static ɵinj: i0.ɵɵInjectorDeclaration<NzTransferModule>;
|
|
}
|
|
|
|
export { NzTransferComponent, NzTransferListComponent, NzTransferModule, NzTransferSearchComponent };
|
|
export type { RenderListContext, TransferCanMove, TransferChange, TransferDirection, TransferItem, TransferSearchChange, TransferSelectChange, TransferStat };
|