Repository navigation
Expand file tree
/
Copy pathindex.d.ts
More file actions
119 lines (103 loc) · 3.97 KB
/
Copy pathindex.d.ts
File metadata and controls
119 lines (103 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import * as React from 'react';
import { ImageRequireSource, FlatListProps, SectionListProps, StyleProp, ViewProps } from 'react-native';
import {Tree, SelectValueType } from '@hecom/general-tree';
export interface PickListState {
levelItems: Tree[];
selectedItems: Tree[];
isSearching: boolean;
searchText: string;
screenWidth: number;
frame?: StyleProp<ViewProps>;
}
export interface PickListProps {
title: string;
data: {} | Array<any>;
navigation: any;
firstTitleLine?: string;
multilevel?: boolean;
multiselect?: boolean;
onFinish?: (selectedItems: Tree[]) => void;
rightTitle?: string | Array<React.ReactElement>;
rightClick?: (index?: number) => void;
renderRow?: (treeNode: Tree, props: PickListProps) => React.ReactElement;
renderHeader?: (selectedItems: Tree[]) => React.ReactElement;
showBottomView?: boolean;
showSearchView?: boolean;
showTitleLine?: boolean;
showAllCell?: boolean;
showCount?: boolean;
numberOfTextLines?: number;
directBackWhenSingle?: boolean;
cancelableWhenDirectBack?: boolean;
selectedIds?: Array<string>;
selectable?: (treeNode: Tree) => boolean;
childrenKey?: string;
idKey?: string | string[];
labelKey?: string;
searchKeys?: string[];
sort?: (a: Tree, b: Tree) => -1 | 0 | 1;
split?: (treeNodes: Tree[]) => Array<Tree | Tree[]>;
flatListProps?: FlatListProps;
sectionListProps?: SectionListProps;
searchListProps?: FlatListProps;
searchListPropsCallBack?: (state: PickListState, data: Tree[], onFinish: (slectedItems: string[]) => void) => FlatListProps;
buttonProps?: ViewProps;
firstRawRootPath?: string;//虚拟节点顶端路径
rootPath?: {(root:any): string};//获取节点路径
parentPath?: {(root:any): string};//获取父节点路径
weakNodeTag?: {(): Element}//虚拟节点标签
isCascade?: boolean; // false: 1. 即使子节点全部被选中,在底部的已选中列表中也不会合并成父节点;2. 点击父节点的小圈圈,不会选中子节点
labels: {
close?: string;
search?: string;
selectAll?: string;
deselectAll?: string;
ok?: string;
choose?: string;
cancel?: string;
};
}
export default class PickList extends React.PureComponent<PickListProps, PickListState> {
getSelectedItems: () => Tree[];
backToPreviousPage: () => boolean;
}
export type PickListRowFunc = (treeNode: Tree, props: PickListProps) => React.ReactElement;
export const PickListDefaultRow: PickListRowFunc;
interface RowUtilType {
singleLevelNode: PickListRowFunc;
multiLevelNode: PickListRowFunc;
multiLevelLeafNode: PickListRowFunc;
multiLevelNotLeafNode: PickListRowFunc;
notselect_image: () => ImageRequireSource;
select_image: () => ImageRequireSource;
incomp_image: () => ImageRequireSource;
single_check_image: () => ImageRequireSource;
getImage: (selectState: SelectValueType) => ImageRequireSource | void;
getSelectState: (treeNode: Tree, cascade?: boolean) => SelectValueType
}
export const PickListRowUtil: RowUtilType;
interface ShowAllCellProps extends PickListProps {
treeNode: Tree;
onPress: (treeNode: Tree) => void;
}
export class PickListShowAllCell extends React.PureComponent<ShowAllCellProps> {}
interface BottomBarProps extends PickListProps {
selectedItems: Tree[];
onPress: () => void;
onPressItem: (index: number) => void;
}
export class PickListBottomBar extends React.PureComponent<BottomBarProps> {}
interface CellProps extends PickListProps {
isSearching: boolean;
treeNode: Tree;
onPress: (treeNode: Tree, isInternal: boolean) => void;
}
interface CellState {
status: SelectValueType;
}
export class PickListCell extends React.Component<CellProps, CellState> {}
interface TitleLineProps extends PickListProps {
levelItems: Tree[];
onPress: (index: number) => void;
}
export class PickListTitleLine extends React.PureComponent<TitleLineProps> {}