UNPKG

4.92 kBSource Map (JSON)View Raw
1{"version":3,"file":"Pivot.types.js","sourceRoot":"../src/","sources":["components/Pivot/Pivot.types.ts"],"names":[],"mappings":";;;AA+IA;;;GAGG;AACH,IAAkB,eAUjB;AAVD,WAAkB,eAAe;IAC/B;;OAEG;IACH,kCAAe,CAAA;IAEf;;OAEG;IACH,gCAAa,CAAA;AACf,CAAC,EAViB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAUhC;AAED;;;GAGG;AACH,IAAkB,aAUjB;AAVD,WAAkB,aAAa;IAC7B;;OAEG;IACH,kCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAe,CAAA;AACjB,CAAC,EAViB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAU9B","sourcesContent":["import * as React from 'react';\nimport { PivotItem } from './PivotItem';\nimport type { IStyle, ITheme } from '@fluentui/style-utilities';\nimport type { IStyleFunctionOrObject } from '@fluentui/utilities';\nimport type { 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.HTMLAttributes<HTMLDivElement>, React.RefAttributes<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?: React.RefObject<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 defaultSelectedKey?: 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 * Link size (normal, large)\n */\n linkSize?: PivotLinkSizeType;\n\n /**\n * Link format (links, tabs)\n */\n linkFormat?: PivotLinkFormatType;\n\n /**\n * Aria label for the overflow button, used if `overflowBehavior` is \"menu\".\n */\n overflowAriaLabel?: string;\n\n /**\n * Overflow behavior when there is not enough room to display all of the links/tabs\n * * none: Pivot links will overflow the container and may not be visible\n * * menu: Display an overflow menu that contains the tabs that don't fit\n *\n * @default none\n */\n overflowBehavior?: 'none' | 'menu';\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 linkSize?: PivotLinkSizeType;\n linkFormat?: PivotLinkFormatType;\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 linkIsSelected: IStyle;\n linkContent: IStyle;\n text: IStyle;\n count: IStyle;\n icon: IStyle;\n linkInMenu: IStyle;\n overflowMenuButton: IStyle;\n itemContainer?: IStyle;\n}\n\n/**\n * {@docCategory Pivot}\n * Display mode for the pivot links/tabs\n */\nexport type PivotLinkFormatType = 'links' | 'tabs';\n\n/**\n * {@docCategory Pivot}\n * Size of the pivot links/tabs\n */\nexport type PivotLinkSizeType = 'normal' | 'large';\n\n/**\n * {@docCategory Pivot}\n * @deprecated Use strings 'links' or 'tabs' instead of this enum\n */\nexport const enum PivotLinkFormat {\n /**\n * Display Pivot Links as links\n */\n links = 'links',\n\n /**\n * Display Pivot Links as Tabs\n */\n tabs = 'tabs',\n}\n\n/**\n * {@docCategory Pivot}\n * @deprecated Use strings 'normal' or 'large' instead of this enum\n */\nexport const enum PivotLinkSize {\n /**\n * Display Link using normal font size\n */\n normal = 'normal',\n\n /**\n * Display links using large font size\n */\n large = 'large',\n}\n"]}
\No newline at end of file