1 | import * as React from 'react';
|
2 | import { CollapseAllVisibility } from '../../GroupedList';
|
3 | import { DetailsHeaderBase } from './DetailsHeader.base';
|
4 | import { DetailsListLayoutMode, ColumnDragEndLocation } from './DetailsList.types';
|
5 | import { SelectionMode } from '../../Selection';
|
6 | import type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '../../Utilities';
|
7 | import type { ITheme, IStyle } from '../../Styling';
|
8 | import type { IColumn, IColumnReorderOptions } from './DetailsList.types';
|
9 | import type { ICellStyleProps, IDetailsItemProps } from './DetailsRow.types';
|
10 | import type { ISelection } from '../../Selection';
|
11 | import type { IDetailsCheckboxProps } from './DetailsRowCheck.types';
|
12 | import type { IDetailsColumnRenderTooltipProps } from './DetailsColumn.types';
|
13 |
|
14 |
|
15 |
|
16 | export interface IDetailsHeader {
|
17 |
|
18 | focus: () => boolean;
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 | export interface IDetailsHeaderBaseProps extends React.ClassAttributes<DetailsHeaderBase>, IDetailsItemProps {
|
24 |
|
25 | theme?: ITheme;
|
26 |
|
27 | styles?: IStyleFunctionOrObject<IDetailsHeaderStyleProps, IDetailsHeaderStyles>;
|
28 |
|
29 | componentRef?: IRefObject<IDetailsHeader>;
|
30 |
|
31 | layoutMode: DetailsListLayoutMode;
|
32 |
|
33 | onColumnIsSizingChanged?: (column: IColumn, isSizing: boolean) => void;
|
34 |
|
35 | onColumnResized?: (column: IColumn, newWidth: number, columnIndex: number) => void;
|
36 |
|
37 | onColumnAutoResized?: (column: IColumn, columnIndex: number) => void;
|
38 |
|
39 | onColumnClick?: (ev: React.MouseEvent<HTMLElement>, column: IColumn) => void;
|
40 |
|
41 | onColumnContextMenu?: (column: IColumn, ev: React.MouseEvent<HTMLElement>) => void;
|
42 |
|
43 | onRenderColumnHeaderTooltip?: IRenderFunction<IDetailsColumnRenderTooltipProps>;
|
44 |
|
45 | collapseAllVisibility?: CollapseAllVisibility;
|
46 |
|
47 | isAllCollapsed?: boolean;
|
48 |
|
49 | onToggleCollapseAll?: (isAllCollapsed: boolean) => void;
|
50 |
|
51 | ariaLabel?: string;
|
52 |
|
53 | ariaLabelForToggleAllGroupsButton?: string;
|
54 |
|
55 | ariaLabelForSelectAllCheckbox?: string;
|
56 |
|
57 | ariaLabelForSelectionColumn?: string;
|
58 |
|
59 | selectAllVisibility?: SelectAllVisibility;
|
60 |
|
61 | columnReorderOptions?: IColumnReorderOptions;
|
62 |
|
63 | columnReorderProps?: IColumnReorderHeaderProps;
|
64 |
|
65 | minimumPixelsForDrag?: number;
|
66 |
|
67 | className?: string;
|
68 |
|
69 | onRenderDetailsCheckbox?: IRenderFunction<IDetailsCheckboxProps>;
|
70 | |
71 |
|
72 |
|
73 |
|
74 |
|
75 | useFastIcons?: boolean;
|
76 | }
|
77 |
|
78 |
|
79 |
|
80 | export interface IDetailsHeaderProps extends IDetailsHeaderBaseProps {
|
81 | |
82 |
|
83 |
|
84 | columns: IColumn[];
|
85 | |
86 |
|
87 |
|
88 | selection: ISelection;
|
89 | |
90 |
|
91 |
|
92 | selectionMode: SelectionMode;
|
93 | }
|
94 |
|
95 |
|
96 |
|
97 | export declare enum SelectAllVisibility {
|
98 | none = 0,
|
99 | hidden = 1,
|
100 | visible = 2
|
101 | }
|
102 |
|
103 |
|
104 |
|
105 | export interface IDetailsHeaderState {
|
106 | columnResizeDetails?: IColumnResizeDetails;
|
107 | isAllSelected?: boolean;
|
108 | isSizing?: boolean;
|
109 | isAllCollapsed?: boolean;
|
110 | }
|
111 |
|
112 |
|
113 |
|
114 | export interface IColumnResizeDetails {
|
115 | columnIndex: number;
|
116 | originX?: number;
|
117 | columnMinWidth: number;
|
118 | }
|
119 |
|
120 |
|
121 |
|
122 | export interface IColumnReorderHeaderProps extends IColumnReorderOptions {
|
123 | |
124 |
|
125 |
|
126 |
|
127 | onColumnDragEnd?: (props: {
|
128 | dropLocation?: ColumnDragEndLocation;
|
129 | }, event: MouseEvent) => void;
|
130 | }
|
131 |
|
132 |
|
133 |
|
134 | export interface IDropHintDetails {
|
135 | originX: number;
|
136 | startX: number;
|
137 | endX: number;
|
138 | dropHintElementRef: HTMLElement;
|
139 | }
|
140 |
|
141 |
|
142 |
|
143 | export declare type IDetailsHeaderStyleProps = Required<Pick<IDetailsHeaderProps, 'theme'>> & Pick<IDetailsHeaderProps, 'className'> & {
|
144 |
|
145 | isSelectAllHidden?: boolean;
|
146 |
|
147 | isAllSelected?: boolean;
|
148 |
|
149 | isResizingColumn?: boolean;
|
150 |
|
151 | isAllCollapsed?: boolean;
|
152 |
|
153 | isSizing?: boolean;
|
154 |
|
155 | isCheckboxHidden?: boolean;
|
156 | cellStyleProps?: ICellStyleProps;
|
157 | };
|
158 |
|
159 |
|
160 |
|
161 | export interface IDetailsHeaderStyles {
|
162 | root: IStyle;
|
163 | check: IStyle;
|
164 | |
165 |
|
166 |
|
167 | cellWrapperPadded: IStyle;
|
168 | cellIsCheck: IStyle;
|
169 | |
170 |
|
171 |
|
172 | cellIsActionable: IStyle;
|
173 | |
174 |
|
175 |
|
176 | cellIsEmpty: IStyle;
|
177 | cellSizer: IStyle;
|
178 | cellSizerStart: IStyle;
|
179 | cellSizerEnd: IStyle;
|
180 | cellIsResizing: IStyle;
|
181 | cellIsGroupExpander: IStyle;
|
182 | collapseButton: IStyle;
|
183 | checkTooltip: IStyle;
|
184 | sizingOverlay: IStyle;
|
185 | dropHintCircleStyle: IStyle;
|
186 | dropHintCaretStyle: IStyle;
|
187 | dropHintLineStyle: IStyle;
|
188 | dropHintStyle: IStyle;
|
189 | accessibleLabel: IStyle;
|
190 | }
|