UNPKG

5.28 kBSource Map (JSON)View Raw
1{"version":3,"file":"Pivot.types.js","sourceRoot":"../src/","sources":["components/Pivot/Pivot.types.ts"],"names":[],"mappings":"AAuJA;;GAEG;AACH,MAAM,CAAN,IAAY,eAUX;AAVD,WAAY,eAAe;IACzB;;OAEG;IACH,uDAAS,CAAA;IAET;;OAEG;IACH,qDAAQ,CAAA;AACV,CAAC,EAVW,eAAe,KAAf,eAAe,QAU1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,qDAAU,CAAA;IAEV;;OAEG;IACH,mDAAS,CAAA;AACX,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB","sourcesContent":["import * as React from 'react';\nimport { PivotBase } from './Pivot.base';\nimport { IStyle, ITheme } from '../../Styling';\nimport { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\nimport { PivotItem } from './PivotItem';\nimport { IFocusZoneProps } from '../../FocusZone';\n\n/**\n * {@docCategory Pivot}\n */\nexport interface IPivot {\n /**\n * Sets focus to the first pivot tab.\n */\n focus(): void;\n}\n\n/**\n * {@docCategory Pivot}\n */\nexport interface IPivotProps extends React.ClassAttributes<PivotBase>, React.HTMLAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the IPivot interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IPivot>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IPivotStyleProps, IPivotStyles>;\n\n /**\n * Theme provided by High-Order Component.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Pivot\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Default selected key for the pivot. Only provide this if the pivot is an uncontrolled component;\n * otherwise, use the `selectedKey` property.\n *\n * This property is also mutually exclusive with `defaultSelectedIndex`.\n */\n defaultSelectedKey?: string;\n\n /**\n * Default selected index for the pivot. Only provide this if the pivot is an uncontrolled component;\n * otherwise, use the `selectedKey` property.\n *\n * This property is also mutually exclusive with `defaultSelectedKey`.\n *\n * @deprecated Use `defaultSelectedKey`\n */\n defaultSelectedIndex?: number;\n\n /**\n * Index of the pivot item initially selected. Mutually exclusive with `initialSelectedKey`.\n * Only provide this if the pivot is an uncontrolled component; otherwise, use `selectedKey`.\n *\n * @deprecated Use `defaultSelectedKey`\n */\n initialSelectedIndex?: number;\n\n /**\n * Key of the pivot item initially selected. Mutually exclusive with `initialSelectedIndex`.\n * Only provide this if the pivot is an uncontrolled component; otherwise, use `selectedKey`.\n *\n * @deprecated Use `defaultSelectedKey`\n */\n initialSelectedKey?: string;\n\n /**\n * Key of the selected pivot item. Updating this will override the Pivot's selected item state.\n * Only provide this if the pivot is a controlled component where you are maintaining the\n * current state; otherwise, use `defaultSelectedKey`.\n */\n selectedKey?: string | null;\n\n /**\n * Callback for when the selected pivot item is changed.\n */\n onLinkClick?: (item?: PivotItem, ev?: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * PivotLinkSize to use (normal, large)\n */\n linkSize?: PivotLinkSize;\n\n /**\n * PivotLinkFormat to use (links, tabs)\n */\n linkFormat?: PivotLinkFormat;\n\n /**\n * Whether to skip rendering the tabpanel with the content of the selected tab.\n * Use this prop if you plan to separately render the tab content\n * and don't want to leave an empty tabpanel in the page that may confuse Screen Readers.\n */\n headersOnly?: boolean;\n\n /**\n * Callback to customize how IDs are generated for each tab header.\n * Useful if you're rendering content outside and need to connect aria-labelledby.\n */\n getTabId?: (itemKey: string, index: number) => string;\n\n /**\n * Props passed to the `FocusZone` component used as the root of `Pivot`.\n */\n focusZoneProps?: IFocusZoneProps;\n}\n\n/**\n * {@docCategory Pivot}\n */\nexport type IPivotStyleProps = Required<Pick<IPivotProps, 'theme'>> &\n Pick<IPivotProps, 'className'> & {\n /** Indicates whether Pivot has large format. */\n rootIsLarge?: boolean;\n /** Indicates whether Pivot has tabbed format. */\n rootIsTabs?: boolean;\n /**\n * Indicates whether Pivot link is selected.\n * @deprecated Is not populated with valid value. Specify `linkIsSelected` styling instead.\n */\n linkIsSelected?: boolean;\n };\n\n/**\n * {@docCategory Pivot}\n */\nexport interface IPivotStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n link: IStyle;\n linkContent: IStyle;\n linkIsSelected: IStyle;\n text: IStyle;\n count: IStyle;\n icon: IStyle;\n itemContainer?: IStyle;\n}\n\n/**\n * {@docCategory Pivot}\n */\nexport enum PivotLinkFormat {\n /**\n * Display Pivot Links as links\n */\n links = 0,\n\n /**\n * Display Pivot Links as Tabs\n */\n tabs = 1,\n}\n\n/**\n * {@docCategory Pivot}\n */\nexport enum PivotLinkSize {\n /**\n * Display Link using normal font size\n */\n normal = 0,\n\n /**\n * Display links using large font size\n */\n large = 1,\n}\n"]}
\No newline at end of file