UNPKG

3.23 kBSource Map (JSON)View Raw
1{"version":3,"file":"ButtonGrid.types.js","sourceRoot":"../src/","sources":["utilities/ButtonGrid/ButtonGrid.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\n\nexport interface IButtonGrid {}\n\nexport interface IButtonGridProps\n extends React.TableHTMLAttributes<HTMLTableElement>,\n React.RefAttributes<HTMLElement> {\n /**\n * Gets the component ref.\n */\n componentRef?: IRefObject<IButtonGrid>;\n\n /**\n * Items to display in a ButtonGrid with the specified number of columns\n */\n items: any[];\n\n /**\n * The number of columns\n */\n columnCount: number;\n\n /**\n * Custom renderer for the individual items\n */\n onRenderItem: (item: any, index: number) => JSX.Element;\n\n /**\n * Whether focus should cycle back to the beginning once the user navigates past the end (and vice versa).\n * Only relevant if `doNotContainWithinFocusZone` is not true.\n */\n shouldFocusCircularNavigate?: boolean;\n\n /**\n * If false (the default), the ButtonGrid is contained inside a FocusZone.\n * If true, a FocusZone is not used.\n * @default false\n */\n doNotContainWithinFocusZone?: boolean;\n\n /**\n * Class name for the FocusZone container for the ButtonGrid.\n * @deprecated Use `styles.focusedContainer` to define styling for the focus zone container\n */\n containerClassName?: string;\n\n /**\n * Handler for when focus leaves the ButtonGrid.\n */\n onBlur?: () => void;\n\n /**\n * If true, uses radiogroup semantics for the ButtonGrid.\n * This should be set to true for single-row grids, for two reasons:\n * 1. Radios are a more simple and understandable control,\n * and a better fit for a single-dimensional selection control\n * 2. Multiple browsers use heuristics to strip table and grid roles from single-row tables with no column headers.\n */\n isSemanticRadio?: boolean;\n\n /**\n * Position this ButtonGrid is in the parent set (index in a parent menu, for example)\n */\n ariaPosInSet?: number;\n\n /**\n * @deprecated Use `ariaPosInSet`\n */\n positionInSet?: number;\n\n /**\n * Size of the parent set (size of parent menu, for example)\n */\n ariaSetSize?: number;\n\n /**\n * @deprecated Use `ariaSetSize`\n */\n setSize?: number;\n\n /**\n * Theme to apply to the component.\n */\n theme?: ITheme;\n\n /**\n * Optional styles for the component.\n */\n styles?: IStyleFunctionOrObject<IButtonGridStyleProps, IButtonGridStyles>;\n}\n\n/**\n * Properties required to build the styles for the ButtonGrid component.\n */\nexport interface IButtonGridStyleProps {\n /**\n * Theme to apply to the ButtonGrid\n */\n theme: ITheme;\n}\n\n/**\n * Styles for the ButtonGrid Component.\n */\nexport interface IButtonGridStyles {\n /**\n * Style for the table container of a ButtonGrid.\n */\n root: IStyle;\n\n /**\n * Style for the table cells of the ButtonGrid.\n */\n tableCell: IStyle;\n\n /**\n * Style for the FocusZone container for the ButtonGrid.\n */\n focusedContainer?: IStyle;\n}\n"]}
\No newline at end of file