UNPKG

4.13 kBSource Map (JSON)View Raw
1{"version":3,"file":"ScrollablePane.types.js","sourceRoot":"../src/","sources":["components/ScrollablePane/ScrollablePane.types.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AA4G/B;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAgB;IACtB,MAAM,EAAE,QAAoB;CAC7B,CAAC;AAoBW,QAAA,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAAyB,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { ScrollablePaneBase } from './ScrollablePane.base';\nimport { Sticky } from '../Sticky/Sticky';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\nimport type { IStyle, ITheme } from '../../Styling';\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePane {\n /** Triggers a layout update for the pane. */\n forceLayoutUpdate(): void;\n /** Gets the current scroll position of the scrollable pane */\n getScrollPosition(): number;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneProps extends React.HTMLAttributes<HTMLElement | ScrollablePaneBase> {\n // export interface IScrollablePaneProps extends IReactProps<ScrollablePaneBase> {\n /**\n * Optional callback to access the IScrollablePane interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IScrollablePane>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject<IScrollablePaneStyleProps, IScrollablePaneStyles>;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the ScrollablePane\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Sets the initial scroll position of the ScrollablePane\n */\n initialScrollPosition?: number;\n\n scrollbarVisibility?: ScrollbarVisibility;\n\n /**\n * Makes the scrollable container focusable, to aid with keyboard-only scrolling\n * Should only be set to true if the scrollable region will not contain any other focusable items\n * @defaultvalue false\n */\n scrollContainerFocus?: boolean;\n\n /**\n * If scrollContainerFocus is set to true, use this to give the container an accessible name\n */\n scrollContainerAriaLabel?: string;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n scrollbarVisibility?: IScrollablePaneProps['scrollbarVisibility'];\n\n // Insert ScrollablePane style props below\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneStyles {\n /**\n * Style set for the root element.\n */\n root: IStyle;\n /**\n * Style set for the stickyAbove element.\n */\n stickyAbove: IStyle;\n /**\n * Style set for the stickyBelow element.\n */\n stickyBelow: IStyle;\n /**\n * Style set for the stickyBelowItems element.\n */\n stickyBelowItems: IStyle;\n /**\n * Style set for the contentContainer element.\n */\n contentContainer: IStyle;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport const ScrollbarVisibility = {\n auto: 'auto' as 'auto',\n always: 'always' as 'always',\n};\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport type ScrollbarVisibility = typeof ScrollbarVisibility[keyof typeof ScrollbarVisibility];\n\nexport interface IScrollablePaneContext {\n scrollablePane?: {\n subscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;\n unsubscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;\n addSticky: (sticky: Sticky) => void;\n removeSticky: (sticky: Sticky) => void;\n updateStickyRefHeights: () => void;\n sortSticky: (sticky: Sticky, sortAgain?: boolean) => void;\n notifySubscribers: (sort?: boolean) => void;\n syncScrollSticky: (sticky: Sticky) => void;\n };\n}\n\nexport const ScrollablePaneContext = React.createContext<IScrollablePaneContext>({ scrollablePane: undefined });\n"]}
\No newline at end of file