@rdkmaster/jigsaw-labs
Version:
Jigsaw, the next generation component set for RDK
111 lines (110 loc) • 3.79 kB
TypeScript
import { OnDestroy } from "@angular/core";
import { ArrayCollection, LocalPageableArray, PageableArray } from "../../core/data/array-collection";
import { GroupOptionValue } from "../list-and-tile/group-common";
import { AbstractJigsawGroupLiteComponent } from "../list-and-tile/group-lite-common";
import { TranslateService } from "@ngx-translate/core";
export declare class JigsawTransfer extends AbstractJigsawGroupLiteComponent implements OnDestroy {
private _removePageableCallbackListener;
private _removeArrayCallbackListener;
private _removeSelectedArrayCallbackListener;
private _filterFunction;
_$data: LocalPageableArray<GroupOptionValue> | PageableArray;
/**
* 设置按钮不可交互状态的开关,为true则不可交互,为false则可交互。
*
* $demo = transfer/disabled
*/
private _disabled;
disabled: boolean;
/**
* 更新transfer的样式信息
* @internal
*/
_$transferClass: {};
data: any[] | ArrayCollection<GroupOptionValue> | LocalPageableArray<GroupOptionValue> | PageableArray;
private _selectedItems;
selectedItems: ArrayCollection<any> | any[];
subLabelField: string;
searchable: boolean;
/**
* @internal
*/
_$sourceSelectedItems: ArrayCollection<GroupOptionValue> | GroupOptionValue[];
/**
* @internal
*/
_$targetSelectedItems: ArrayCollection<GroupOptionValue> | GroupOptionValue[];
private _filterDataBySelectedItems();
private _filterData();
/**
* @Internal
*
* data和selectedItems不和list里数据双绑,list里面要做一些转换
*
* @param {string} from
* @private
*/
_$transferTo(from: string): void;
ngOnDestroy(): void;
}
export declare class JigsawTransferInternalList extends AbstractJigsawGroupLiteComponent implements OnDestroy {
private _transfer;
constructor(_transfer: JigsawTransfer);
disabled: boolean;
isTarget: boolean;
private _data;
data: LocalPageableArray<GroupOptionValue> | PageableArray;
subLabelField: string;
trackItemBy: string | string[];
searchable: boolean;
private _removeHostSubscribe;
private _filterFunction;
private _removeArrayCallbackListener;
/**
* @internal
*/
_$searchKey: string;
/**
* @internal
*/
_$currentPageSelectedItems: any[] | ArrayCollection<any>;
/**
* @internal
*/
_$infinity: number;
/**
* @internal
*/
readonly _$trackByFn: (index: number, item: any) => any;
/**
* 这边把transfer过来的数组转成分页数据,中间变量data主要用于消除数据闪动
* @param {GroupOptionValue[] | ArrayCollection<GroupOptionValue>} value
* @private
*/
private _updateData(value);
/**
* @internal
*/
_$handleSearching(filterKey?: string): void;
private _filterData(filterKey, field);
/**
* @internal
*
* 这里有几个需要注意的地方:
* - this.data.concat() 不仅为了浅拷贝数据,当this.data是分页数据的时候,还有一个目的是为了取出this.data的当前页数据
* - 在过滤选中的条目是直接用了`item.disabled`,在item的类型是字符串时,也没问题,因为字符串的时候,`item.disabled`必然是false
*/
_$handleHeadSelect(checked: any): void;
/**
* @internal
*/
_$updateCurrentPageSelectedItems(): void;
/**
* @internal
*/
_$updateSelectedItemsByCurrent(): void;
ngOnDestroy(): void;
}
export declare class JigsawTransferModule {
constructor(translateService: TranslateService);
}