UNPKG

7.12 kBSource Map (JSON)View Raw
1{"version":3,"file":"DetailsHeader.types.js","sourceRoot":"../src/","sources":["components/DetailsList/DetailsHeader.types.ts"],"names":[],"mappings":";;;AA0HA;;GAEG;AACH,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,6DAAQ,CAAA;IACR,iEAAU,CAAA;IACV,mEAAW,CAAA;AACb,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B","sourcesContent":["import * as React from 'react';\nimport { CollapseAllVisibility } from '../../GroupedList';\nimport { DetailsHeaderBase } from './DetailsHeader.base';\nimport { DetailsListLayoutMode, ColumnDragEndLocation } from './DetailsList.types';\nimport { SelectionMode } from '../../Selection';\nimport type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '../../Utilities';\nimport type { ITheme, IStyle } from '../../Styling';\nimport type { IColumn, IColumnReorderOptions } from './DetailsList.types';\nimport type { ICellStyleProps, IDetailsItemProps } from './DetailsRow.types';\nimport type { ISelection } from '../../Selection';\nimport type { IDetailsCheckboxProps } from './DetailsRowCheck.types';\nimport type { IDetailsColumnRenderTooltipProps } from './DetailsColumn.types';\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsHeader {\n /** sets focus into the header */\n focus: () => boolean;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsHeaderBaseProps extends React.ClassAttributes<DetailsHeaderBase>, IDetailsItemProps {\n /** Theme from the Higher Order Component */\n theme?: ITheme;\n\n /** Call to provide customized styling that will layer on top of the variant rules. */\n styles?: IStyleFunctionOrObject<IDetailsHeaderStyleProps, IDetailsHeaderStyles>;\n\n /** Ref to the component itself */\n componentRef?: IRefObject<IDetailsHeader>;\n\n /** Layout mode - fixedColumns or justified */\n layoutMode: DetailsListLayoutMode;\n\n /** Callback for when column sizing has changed */\n onColumnIsSizingChanged?: (column: IColumn, isSizing: boolean) => void;\n\n /** Callback for when column is resized */\n onColumnResized?: (column: IColumn, newWidth: number, columnIndex: number) => void;\n\n /** Callback for when column is automatically resized */\n onColumnAutoResized?: (column: IColumn, columnIndex: number) => void;\n\n /** Callback for when the column is clicked */\n onColumnClick?: (ev: React.MouseEvent<HTMLElement>, column: IColumn) => void;\n\n /** Callback for when the column needs to show a context menu */\n onColumnContextMenu?: (column: IColumn, ev: React.MouseEvent<HTMLElement>) => void;\n\n /** Callback to render a tooltip for the column header */\n onRenderColumnHeaderTooltip?: IRenderFunction<IDetailsColumnRenderTooltipProps>;\n\n /** Whether to collapse for all visibility */\n collapseAllVisibility?: CollapseAllVisibility;\n\n /** Whether or not all is collapsed */\n isAllCollapsed?: boolean;\n\n /** Callback for when collapse all is toggled */\n onToggleCollapseAll?: (isAllCollapsed: boolean) => void;\n\n /** ariaLabel for the entire header */\n ariaLabel?: string;\n\n /** ariaLabel for expand/collapse group button */\n ariaLabelForToggleAllGroupsButton?: string;\n\n /** ariaLabel for the header checkbox that selects or deselects everything */\n ariaLabelForSelectAllCheckbox?: string;\n\n /** ariaLabel for the selection column */\n ariaLabelForSelectionColumn?: string;\n\n /** Select all button visibility */\n selectAllVisibility?: SelectAllVisibility;\n\n /** Column reordering options */\n columnReorderOptions?: IColumnReorderOptions;\n\n /** Column reordering options */\n columnReorderProps?: IColumnReorderHeaderProps;\n\n /** Minimum pixels to be moved before dragging is registered */\n minimumPixelsForDrag?: number;\n\n /** Overriding class name */\n className?: string;\n\n /** If provided, can be used to render a custom checkbox */\n onRenderDetailsCheckbox?: IRenderFunction<IDetailsCheckboxProps>;\n\n /**\n * Whether to use fast icon and check components. The icons can't be targeted by customization\n * but are still customizable via class names.\n * @defaultvalue true\n */\n useFastIcons?: boolean;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsHeaderProps extends IDetailsHeaderBaseProps {\n /**\n * Column metadata\n */\n columns: IColumn[];\n\n /**\n * Selection from utilities\n */\n selection: ISelection;\n\n /**\n * Selection mode\n */\n selectionMode: SelectionMode;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport enum SelectAllVisibility {\n none = 0,\n hidden = 1,\n visible = 2,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsHeaderState {\n columnResizeDetails?: IColumnResizeDetails;\n isAllSelected?: boolean;\n isSizing?: boolean;\n isAllCollapsed?: boolean;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IColumnResizeDetails {\n columnIndex: number;\n originX?: number;\n columnMinWidth: number;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IColumnReorderHeaderProps extends IColumnReorderOptions {\n /** Callback to notify the column dragEnd event to List\n * Need this to check whether the dragEnd has happened on\n * corresponding list or outside of the list\n */\n onColumnDragEnd?: (props: { dropLocation?: ColumnDragEndLocation }, event: MouseEvent) => void;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDropHintDetails {\n originX: number; // X index of dropHint Element relative to header\n startX: number; // start index of the range for the current drophint\n endX: number; // end index of the range for the current drophint\n dropHintElementRef: HTMLElement; // Reference for drophint to change the style when needed\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport type IDetailsHeaderStyleProps = Required<Pick<IDetailsHeaderProps, 'theme'>> &\n Pick<IDetailsHeaderProps, 'className'> & {\n /** Whether to hide select all checkbox */\n isSelectAllHidden?: boolean;\n\n /** Whether the \"select all\" checkbox is checked */\n isAllSelected?: boolean;\n\n /** Is column being resized */\n isResizingColumn?: boolean;\n\n /** Are all columns collapsed */\n isAllCollapsed?: boolean;\n\n /** Whether the header is sizing */\n isSizing?: boolean;\n\n /** Whether checkbox is hidden */\n isCheckboxHidden?: boolean;\n\n cellStyleProps?: ICellStyleProps;\n };\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsHeaderStyles {\n root: IStyle;\n check: IStyle;\n\n /**\n * @deprecated Not used\n */\n cellWrapperPadded: IStyle;\n cellIsCheck: IStyle;\n\n /**\n * @deprecated Not used\n */\n cellIsActionable: IStyle;\n\n /**\n * @deprecated Not used\n */\n cellIsEmpty: IStyle;\n cellSizer: IStyle;\n cellSizerStart: IStyle;\n cellSizerEnd: IStyle;\n cellIsResizing: IStyle;\n cellIsGroupExpander: IStyle;\n collapseButton: IStyle;\n checkTooltip: IStyle;\n sizingOverlay: IStyle;\n dropHintCircleStyle: IStyle;\n dropHintCaretStyle: IStyle;\n dropHintLineStyle: IStyle;\n dropHintStyle: IStyle;\n accessibleLabel: IStyle;\n}\n"]}
\No newline at end of file